diff options
author | Tarmo Tänav <tarmo@itech.ee> | 2008-07-03 17:49:12 +0300 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2008-07-03 16:11:50 +0100 |
commit | a37d065f85941e1fe746dff4d42f015e1618834f (patch) | |
tree | 2e498068f1ec02c083150c2471243c5114bf3b1d /actionpack/lib | |
parent | d20e8dd2207a848e2712c19ad38d6abb6f98ca07 (diff) | |
download | rails-a37d065f85941e1fe746dff4d42f015e1618834f.tar.gz rails-a37d065f85941e1fe746dff4d42f015e1618834f.tar.bz2 rails-a37d065f85941e1fe746dff4d42f015e1618834f.zip |
Use :namespace instead of :path_prefix for finding controller. [#544 state:resolved]
:namespace is supposed to be the module where controller exists.
:path_prefix can contain anything, including variables, which
makes it unsuitable for determining the module for a controller.
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_controller/routing/builder.rb | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/routing/builder.rb b/actionpack/lib/action_controller/routing/builder.rb index 4740113ed0..b8323847fd 100644 --- a/actionpack/lib/action_controller/routing/builder.rb +++ b/actionpack/lib/action_controller/routing/builder.rb @@ -67,10 +67,9 @@ module ActionController options = options.dup if options[:namespace] - options[:controller] = "#{options[:path_prefix]}/#{options[:controller]}" + options[:controller] = "#{options.delete(:namespace).sub(/\/$/, '')}/#{options[:controller]}" options.delete(:path_prefix) options.delete(:name_prefix) - options.delete(:namespace) end requirements = (options.delete(:requirements) || {}).dup |