diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-01-12 15:21:09 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-01-12 15:21:09 +0000 |
commit | cb8a020ec941101902307b81f4a1a6b9ac6d224d (patch) | |
tree | ca2972ee27b3cb3d9752b3ff296e5fd5178437ee /actionpack/lib | |
parent | 8d5d7161eb3817c5469384b94a58eb82d17c0362 (diff) | |
download | rails-cb8a020ec941101902307b81f4a1a6b9ac6d224d.tar.gz rails-cb8a020ec941101902307b81f4a1a6b9ac6d224d.tar.bz2 rails-cb8a020ec941101902307b81f4a1a6b9ac6d224d.zip |
Fixed url rewriter confusion when the controller name was a substring of the controller_prefix
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@397 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_controller/url_rewriter.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/url_rewriter.rb b/actionpack/lib/action_controller/url_rewriter.rb index cb6baf2c13..1ff172e8ad 100644 --- a/actionpack/lib/action_controller/url_rewriter.rb +++ b/actionpack/lib/action_controller/url_rewriter.rb @@ -88,10 +88,13 @@ module ActionController elsif action_prefix && !action_prefix.empty? path = path.sub(action_prefix, action_name(options, action_prefix)) else - path = path.sub(%r(#{@controller}/?), @controller + "/" + action_name(options)) # " ruby-mode + path = path.sub(%r(#{@controller}/?$), @controller + "/" + action_name(options)) # " ruby-mode end else - path = path.sub(@controller + "/" + (action_prefix || "") + @action + (action_suffix || ""), @controller + "/" + action_name(options, action_prefix)) + path = path.sub( + @controller + "/" + (action_prefix || "") + @action + (action_suffix || ""), + @controller + "/" + action_name(options, action_prefix) + ) end if options[:controller_prefix] && !options[:controller] |