I want to setup a route so that if the user goes to http://mysite.com/page.html it is routed to the controller page_controller and the action index. How would I do this?
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.
The usual setup would be to use ressource mapping for this by adding the following line to routes.rb
map.resources :pages
However that will link to http://mysite.com/pages.html and use pages_controller (notice the plural!). But you should be using plurals anyway if you want to stick to the standard Rails way.