Forum: Ruby on Rails How to pass multiple parameters with a URL or link_to???

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Mister Yu (Guest)
on 2007-08-01 01:53
(Received via mailing list)
Hi all,

==in my countroller i want to do something like this:==

photo_controller

def show
   @photo = Photo.find(params[:photo_id])
   @place = Place.find(params[:place_id))
end

==so that in a view i can do something like this:==

place->show.rhtml

<h2> <%= @place.name %> </h2>
<%= image_tag @photo.file.url %>


how do i write the link_to statement so that i can do that? something
like:
link_to "Show the picture of the place", { :controller =>
"photo", :action => "show", :photo_id => @photo, :place_id => @place}
%>

Thank you very much.
This topic is locked and can not be replied to.