File tree Expand file tree Collapse file tree 3 files changed +14
-5
lines changed
Expand file tree Collapse file tree 3 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ def create
3333 # PATCH/PUT /lunchboxes/1
3434 def update
3535 if @lunchbox . update ( lunchbox_params )
36- redirect_to @lunchbox , notice : 'Lunchbox was successfully updated.'
36+ redirect_to admin_lunchboxes_path , notice : 'Lunchbox was successfully updated.'
3737 else
3838 render :edit
3939 end
Original file line number Diff line number Diff line change 1- = form_for @lunchbox do |f |
1+ = form_for( @lunchbox , url: admin_lunchbox_path( @lunchbox )) do |f |
22 - if @lunchbox .errors.any?
33 #error_explanation
44 h2 = " #{ pluralize(@lunchbox .errors.count, " error" ) } prohibited this lunchbox from being saved:"
55 ul
66 - @lunchbox .errors.full_messages.each do |message |
77 li = message
88
9+ fieldset
10+ .form-group
11+ = f.label :name
12+ = f.text_field :name , class : ' form-control'
13+
14+ .form-group
15+ = f.label :price
16+ = f.text_field :price , class : ' form-control'
17+
918 .actions = f.submit
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ h1 Editing lunchbox
22
33== render ' form'
44
5- = link_to ' Show' , @lunchbox
6- ' |
7- = link_to ' Back' , lunchboxes_path
5+ / = link_to 'Show', @lunchbox
6+ / ' |
7+ / = link_to 'Back', lunchboxes_path
88
You can’t perform that action at this time.
0 commit comments