Nik
2008-Apr-10 23:16 UTC
How to: use one form for updating an entry which the user specifies by.e.g., click on it.
Hello, thank you for paying attention to my post! So basically, I have a list of entries: <% for x in Chore.find(:all) %> <li><%= x.title %></li> <% end %> <%= form_tag :url => {:controller => ''chore'', :action => ''update''} do %> <%= text_field_tag :title %> <%= submit_tag %> <% end %> Let''s say, one chore entry is spelled incorrectly and I would like to change it, could I do something as clicking on the title and then it shows up in the text field, then I change the spelling and hit submit? The difficulty I encountered is how one passes the "id" to the URL so that the update "knows" whom to update. Thank You A Million!! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Julian Leviston
2008-Apr-10 23:55 UTC
Re: How to: use one form for updating an entry which the user specifies by.e.g., click on it.
Yeah, take a look into in-place editing. Julian. Learn Ruby on Rails! Check out the FREE VIDS (for a limited time) VIDEO #3 out NOW! http://sensei.zenunit.com/ On 11/04/2008, at 9:16 AM, Nik wrote:> > Hello, thank you for paying attention to my post! So basically, I have > a list of entries: > <% for x in Chore.find(:all) %> > <li><%= x.title %></li> > <% end %> > > <%= form_tag :url => {:controller => ''chore'', :action => ''update''} do > %> > <%= text_field_tag :title %> > <%= submit_tag %> > <% end %> > > Let''s say, one chore entry is spelled incorrectly and I would like to > change it, could I do something as clicking on the title and then it > shows up in the text field, then I change the spelling and hit submit? > > The difficulty I encountered is how one passes the "id" to the URL so > that the update "knows" whom to update. > > Thank You A Million!! > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---