Take the 2-minute tour ×

I have a page_controller with a few actions (dashboard, rules, contact). Each has a corresponding view. I don't know how to route it in Rails 3.

match 'page/:action' => 'page#:action'

The above doesn't work - what I would like is named routes like: page_path(:dashboard) or page_dashboard_path.

Any ideas?

  • Jacob
share|improve this question

1 Answer 1

up vote 1 down vote accepted

You will have to write

get 'page/dashboard'
get 'page/rules'
get 'page/contact'

That will generate the correct named routes.

Note: you can always type rake routes to see which named routes are created. For more info: see documentation.

share|improve this answer

Your Answer


