Allow use of :path_prefix and :name_prefix outside of namespaced routes. [#1188 state:resolved]

Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
This commit is contained in:
Tom Stuart
2008-10-08 09:31:00 +01:00
committed by Pratik Naik
parent aec391621b
commit e28ad77bba
2 changed files with 22 additions and 3 deletions

View File

@@ -60,12 +60,10 @@ module ActionController
# segments are passed alongside in order to distinguish between default values
# and requirements.
def divide_route_options(segments, options)
options = options.dup
options = options.except(:path_prefix, :name_prefix)
if options[:namespace]
options[:controller] = "#{options.delete(:namespace).sub(/\/$/, '')}/#{options[:controller]}"
options.delete(:path_prefix)
options.delete(:name_prefix)
end
requirements = (options.delete(:requirements) || {}).dup