I have very interesting scenario:
I’ve specified two controllers, one for global events and another another once for company specific events. In routes, it is specified like this:
resources :companies do
resources :events
end
resources: events
Running rake routes I can see the routes being generated:
events GET /events(.:format) events#index
company_events GET /companies/:company_id/events(.:format) events#index
Both paths seem to route to the same controller (the global one)…
I have the second controller under controller/companies that goes something like this:
class Companies::EventsController < ApplicationController
# stuff
end
It never routes in that controller above, no matter whether I use company_evens_path(@company). always goes to the other one.
It used to work in rails 2.3 for me, I’m currently using 3.2
Ok as stated above, I would recommend doing something like this:
although if you need to you can specify a controller:
and just create a companies folder inside your controllers folder to put your Companies::EventsController inside