Help with photo album app

K

Kaspir Ghost

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!
 
J

Josh Cheek

[Note: parts of this message were removed to make it a legal post.]

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!
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,995
Messages
2,570,235
Members
46,821
Latest member
AleidaSchi

Latest Threads

Top