I am getting above error while updating an item using form_tag helper. <h1>Edit Topic Item</h1> <% form_tag edit_topic_item_path(@item.topic, @item), :html => { :method => :put} do %> <%= render :partial => ''item_form'', :object => @item %> <%= submit_tag ''Save'' %> <% end %> <%= link_to ''Add Sub-Item to this Element'', :action => :add_subitem, :id => @item %> <br /> <br /> Any clues? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 9 Mar 2009, at 15:48, Carlos Santana wrote:> > I am getting above error while updating an item using form_tag helper. > > <h1>Edit Topic Item</h1> > > <% form_tag edit_topic_item_path(@item.topic, @item), :html => > { :method > => :put} do %> > <%= render :partial => ''item_form'', :object => @item %> > <%= submit_tag ''Save'' %> > <% end %> > > <%= link_to ''Add Sub-Item to this Element'', :action > => :add_subitem, :id > => @item %> > <br /> > <br /> >edit_topic_item_path returns the path to the edit page, which isn''t where you want to send your updates to If I were you I''d just use form_for which hangles all that sort of stuff for you. Fred> Any clues? > -- > Posted via http://www.ruby-forum.com/. > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks Fred once again A big blunder over there.. :( I am cleaning up someone else''s code and I am new to to rails. And majority of the developers seem to be using form_for and not form_tag. I found it useful as it directly handles ActiveRecord objects... So for my new code I am using the same. Frederick Cheung wrote:> On 9 Mar 2009, at 15:48, Carlos Santana wrote: > >> <% end %> >> >> <%= link_to ''Add Sub-Item to this Element'', :action >> => :add_subitem, :id >> => @item %> >> <br /> >> <br /> >> > > edit_topic_item_path returns the path to the edit page, which isn''t > where you want to send your updates to > > If I were you I''d just use form_for which hangles all that sort of > stuff for you. > > Fred-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---