How to force rails 4 to reload all route files?
That is without having to restart the application to make the routes from /config/routes/.rb get loaded*
I did a split them up in /config/routes/.rb
but these /config/routes/ files are not reloaded.
This worked in rails 3 but not 4:
#config.paths['config/routes'].unshift *Dir["config/routes/*.rb"]
You can use:
You can read about it here (will have to use
find
)In Rails 3, if you are splitting the
routes.rb
file into multiple files, we have to add this line to application.rb:...and the corresponding routes in
config/routes/*.rb
files like this:In Rails 4, Rails no longer provides a
["config/routes"]
key inRails::Engine.paths
. However, in Rails 4, there is no need to add toconfig.path
inapplication.rb
.Just add the corresponding routes under
config/routes/*.rb
.