From: Josh Cheek Date: 2010-08-28T15:55:14+09:00 Subject: Re: Help with photo album app --0016364592c27b723c048edcb6e0 Content-Type: text/plain; charset=ISO-8859-1 On Fri, Aug 27, 2010 at 9:12 AM, Kaspir Ghost wrote: > I'm developing a photo album app that has albums, with pictures > displayed inside of the albums. When you click on the photo, it goes to > the photo's url. What I would like it to do, is go to "picture.html.erb" > in "views/albums" so I can style it, and add "Next" and "Previous" > links. > > This is the last thing I have to do to the album then I'm done, so it > figures I would run into a problem with this. I tried linking straight > to "picture.html.erb" and it brings error: > > No route matches "/albums/picture.html.erb" with {:method=>:get} > > I'm not sure what to do about this. Also, I've no idea in what direction > to go when creating the preivous and next links for the pictures. Could > somebody please give me a push in the right direction or a link to a > tutorial? > > Many thanks in advance! > -- > Posted via http://www.ruby-forum.com/. > > I assume you are using Rails (this is a Ruby mailing list, not a Ruby on Rails mailing list). You will get more pertinent responses on a Rails mailing list. In the meantime, what you need to realize is that routes determine what controller to invoke, not what view to render. Presumably you want the controller that is associated with the picture show. It will probably look about like this: $ rake routes | grep picture | grep show picture GET /pictures/:id(.:format) {:controller=>"pictures", :action=>"show"} For more information, try the guide on routing: http://guides.rubyonrails.org/routing.html --0016364592c27b723c048edcb6e0--