In Rails 3, if you split the routes.rb into multiple files, we must add this line to application.rb:
config.paths['config/routes'].concat Dir[Rails.root.join("config/routes/*.rb")]
... and the corresponding routes in the config/routes/*.rb files, for example:
TestApp::Application.routes.draw do namespace :api do resources :test end end
In Rails 4, Rails no longer provides the key ["config/routes"] in Rails::Engine.paths . However, in Rails 4 there is no need to add to config.path in application.rb .
Just add the appropriate routes to <<22>.
Rukmangathan govindarajan
source share