mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
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
1 changed files with 1 additions and 1 deletions
|
@ -166,7 +166,7 @@ module Rails
|
|||
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 a new issue