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:
Phil Smith 2010-04-19 12:43:42 -07:00 committed by Michael Koziarski
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