What are the paths that is automatically added by Rails? Let say you have a Question resource you automatically get questions_path, question_path etc. Where do I see what they resolve to and what I get?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This section might be helpful http://guides.rubyonrails.org/routing.html#specifying-a-controller-to-use
If you want to create a helper for
showaction you can writewhere
@photois your model object. Or you can pass@photodirectly if it responds toidmethod.You can also load
rails console(in terminal) and test routes usingapplike soapp.photo_path(1)(it will show you the route for the photo withidequals1)