Improve requiring of additional routes

This is more appropriate, and allows changes the separate route files to
be loaded automatically in the development environment.
This commit is contained in:
Kristina Lim
2018-08-06 09:58:40 +08:00
parent 4d34693c05
commit b67c8cc9f1
2 changed files with 6 additions and 3 deletions

View File

@@ -92,6 +92,12 @@ module Openfoodnetwork
#{config.root}/app/jobs
)
config.paths["config/routes"] = %w(
config/routes.rb
config/routes/admin.rb
config/routes/spree.rb
).map { |relative_path| Rails.root.join(relative_path) }
# Only load the plugins named here, in the order given (default is alphabetical).
# :all can be used as a placeholder for all plugins not explicitly named.
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]

View File

@@ -112,6 +112,3 @@ Openfoodnetwork::Application.routes.draw do
mount Spree::Core::Engine, :at => '/'
end
require Rails.root.join("config/routes/admin.rb")
require Rails.root.join("config/routes/spree.rb")