diff options
author | Damien Mathieu <42@dmathieu.com> | 2011-06-01 15:50:49 +0200 |
---|---|---|
committer | Damien Mathieu <42@dmathieu.com> | 2011-06-01 15:51:36 +0200 |
commit | 8a0ffa7c9521c6c8d4298422ae1504d9d839987e (patch) | |
tree | 2bae60caa1fd041e5c58325cdca5573ad49114d4 /actionpack/lib/action_dispatch | |
parent | 1ff4bfc147d301d37fe3f9c5f1d081dcd16ec35d (diff) | |
download | rails-8a0ffa7c9521c6c8d4298422ae1504d9d839987e.tar.gz rails-8a0ffa7c9521c6c8d4298422ae1504d9d839987e.tar.bz2 rails-8a0ffa7c9521c6c8d4298422ae1504d9d839987e.zip |
fix creating an empty route on 1.8. Closes #1210
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index 3999bd0a5e..ec76d1da1e 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -1423,7 +1423,9 @@ module ActionDispatch end def action_path(name, path = nil) #:nodoc: - path || @scope[:path_names][name.to_sym] || name.to_s + # Ruby 1.8 can't transform empty strings to symbols + name = name.to_sym if name.is_a?(String) && !name.empty? + path || @scope[:path_names][name] || name.to_s end def prefix_name_for_action(as, action) #:nodoc: |