I have a ‘companies_controller’ which is getting big as it is controlling everything. A company has a service which I need it to be set ‘sub-route’ of companies.
I routed my company like this:
resources :companies do
member do
get 'services/service'
end
end
I use this to access my route:
services_service_company_path
I get this:
Routing Error
uninitialized constant Companies
Any help? I’m new to Rail/Ruby so I’m not sure how to state my problem correctly.
If you want to have
servicesas a nested controller of companies, you can do something like:If besides the REST routes provided by resources you also need a
GET service: