aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/routing
diff options
context:
space:
mode:
authorEmilio Tagua <miloops@gmail.com>2010-09-29 11:37:08 -0300
committerEmilio Tagua <miloops@gmail.com>2010-09-29 12:42:51 -0300
commit152580ee00205b42de45950d69349c6eab6dd291 (patch)
tree00b488610ebed41d1ff09bad5d6e569d63b52dcb /actionpack/lib/action_dispatch/routing
parentbc0e7f4e374d4f72d1254f51e8c116f358826855 (diff)
downloadrails-152580ee00205b42de45950d69349c6eab6dd291.tar.gz
rails-152580ee00205b42de45950d69349c6eab6dd291.tar.bz2
rails-152580ee00205b42de45950d69349c6eab6dd291.zip
Don't try to interpolate string if there's no interpolation point at all.
Diffstat (limited to 'actionpack/lib/action_dispatch/routing')
-rw-r--r--actionpack/lib/action_dispatch/routing/mapper.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb
index 0cb02c5b80..189da138d8 100644
--- a/actionpack/lib/action_dispatch/routing/mapper.rb
+++ b/actionpack/lib/action_dispatch/routing/mapper.rb
@@ -349,7 +349,7 @@ module ActionDispatch
options = args.last.is_a?(Hash) ? args.pop : {}
path = args.shift || block
- path_proc = path.is_a?(Proc) ? path : proc { |params| params.empty? ? path : (path % params) }
+ path_proc = path.is_a?(Proc) ? path : proc { |params| (params.empty? || !path.match(/%{\w*}/)) ? path : (path % params) }
status = options[:status] || 301
lambda do |env|