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:
Rails.application.reload_routes!
You can read about it here (will have to use find
)
config.paths["config/routes.rb"] << YOUR_ROUTE_FILE
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With