This doesn't work because the NewAccountController class gets all the
incoming requests (URLs prefixed with "new_account"). What I would like
is a conventional way for the following URLs to work without using
routes.rb.
What I would like to have happen is have the NewAccountController
render a page with links to the scoped controllers, ie.
NewAccount::[Business|Personal]Controller. Basically, the URL at
/new_account will give an overview of the Personal and Business
accounts and provide links to each controller's index action.
It seems like there may be a better way. Any help is much appreciated.
This doesn't work because the NewAccountController class gets all the
incoming requests (URLs prefixed with "new_account"). What I would like
is a conventional way for the following URLs to work without using
routes.rb.
What I would like to have happen is have the NewAccountController
render a page with links to the scoped controllers, ie.
NewAccount::[Business|Personal]Controller. Basically, the URL at
/new_account will give an overview of the Personal and Business
accounts and provide links to each controller's index action.
It seems like there may be a better way. Any help is much appreciated.
-pachl
Reply
The easiest way to do this is probably to create new controllers normally for Business and Personal and set up routes to make them function hierarchically. For instance, you might say:
Alternately, you could write a method has_children that you call in NewAccountController, that takes the names of the child controllers and dynamically generates methods that will render the correct pages.