quick question about link_to if i wanted to pass an id using link to i could do something like this... <%= link_to "somewhere", :action => "someaction", :id => somerecord %> What if i wanted to send 2 id''s with the link to? How would i do that So when the action i am linking to is called i have params[:id] and params[:id2] both set <%= link_to "somewhere", :action => "someaction", :id => somerecord, id2 => someotherrecord %> Thanks for your help. -- 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 -~----------~----~----~----~------~----~------~--~---
Remember that params is just a hash. As long as you have something to catch the keys in the controller, they can be anything you want. You may have to do it like this though: link_to "somewhere", :action => "someaction", {:id => somerecord, :id2 => otherrecord } -- 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 -~----------~----~----~----~------~----~------~--~---
Taylor Strait wrote:> Remember that params is just a hash. As long as you have something to > catch the keys in the controller, they can be anything you want. You > may have to do it like this though: > > link_to "somewhere", :action => "someaction", {:id => somerecord, :id2 > => otherrecord }ahh the hash... thats what i was missing. Thanks for the help -- 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 -~----------~----~----~----~------~----~------~--~---