Regexp.escape(load_path) in add_routing_namespaces initializer [#4442 state:resolved]
Signed-off-by: Michael Koziarski <michael@koziarski.com>
This commit is contained in:
parent
69bd542d61
commit
d03196c89e
@ -166,7 +166,7 @@ def load_tasks
|
||||
paths.app.controllers.to_a.each do |load_path|
|
||||
load_path = File.expand_path(load_path)
|
||||
Dir["#{load_path}/*/**/*_controller.rb"].collect do |path|
|
||||
namespace = File.dirname(path).sub(/#{load_path}\/?/, '')
|
||||
namespace = File.dirname(path).sub(/#{Regexp.escape(load_path)}\/?/, '')
|
||||
app.routes.controller_namespaces << namespace unless namespace.empty?
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user