Problems with routing a Rails form_for -
I have a form that I'm using to try and update the field on 'cheese', though , I'm getting massive problems which are probably down to the stupid.
My code is as follows:
& lt;% form_for: thing ,: url = & gt; {: Action = & gt; "Update"}. F | & Gt%; & Lt;% = f.collection_select: status_id, Thing.States ,: First, Last: & gt; & Lt;% = f.submit 'Deposit'% & gt; & Lt;% end% & gt; This looks right for me (@ item BTW is present), however, when I submit it to me
unknown action no action 145 Feedback etc etc is the URL. What am i doing wrong
If you were using the route routing (and I'm assuming that you are) you You can:
& lt;% form_for @thing do F | & Gt%; & Lt;% = f.collection_select: status_id, Thing.States ,: First, Last: & gt; & Lt;% = f.submit 'Deposit'% & gt; & Lt;% end% & gt; And it will point to the correct action if @thing a new_record? is not it or not.
Comments
Post a Comment