I have a controller without any related model. This controller should cover some information from different models. I have many actions that define certain views on a page. What would be the best way to organize routes for this controller?
What I would like is to have / dashboard / something point to any action in the control panel controller. Not actions like new / edit, but arbitrary actions (showstats, etc.).
With trial and error, I did something like this:
map.dashboard 'dashboard/:action', :controller => 'dashboard', :action => :action
You can now access these URLs using the helper:
dashboard_url('actionname')
This approach seems to work fine, but is it? I don’t quite understand how helper method names are generated. How to generate the same helper names as in the base action_controller_url controllers? This will be more general and make the code more consistent.
Thanks in advance.
source
share