In my rails application, I have a controller called demo which is stored at chart directory, I need to access a action called “home” in the demo controller, how should I need to write match in route.rb ?
match ‘:controller(/:action(/:id))(.:format)’
This is the only line what i have
site.com/chart/demo/home should call
app/controllers/chart/demo_controller.rb #action home
Thanks in advance,
Kannan
You could make a namespace for the chart, if you’ve got many controllers that will function behind the ‘chart directory.’
Then you’ve got to make sure that your demo controller indicates the namespace by changing:
to
and make sure that your demo controller is inside of a chart directory.
Then you can always check your routes using rake:routes in the console.