Link_to

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.

link_to “somewhere”, { :action => “someaction”, :id => somerecord, :id2
=>
otherrecord } perhaps.

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 }

Taylor S. 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