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

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and 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:==


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

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


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

how do i write the link_to statement so that i can do that? something
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.