diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-09-25 17:40:34 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-09-25 17:40:37 -0300 |
commit | 9d05d6de52871e57bfbf54a60de005e8a5f5b0e4 (patch) | |
tree | 851dfa8132abb3ae8a872fdd9750040ecee1364c | |
parent | 0863c9248fd47a15e88e05ce4fcd80966684c0e3 (diff) | |
parent | f10b38bbc875bbf016862602b9383b95e59e352a (diff) | |
download | rails-9d05d6de52871e57bfbf54a60de005e8a5f5b0e4.tar.gz rails-9d05d6de52871e57bfbf54a60de005e8a5f5b0e4.tar.bz2 rails-9d05d6de52871e57bfbf54a60de005e8a5f5b0e4.zip |
Merge pull request #16966 from why-el/symbolize-path-params
Ensure named path params are symbols (Fixes #16958)
-rw-r--r-- | actionpack/lib/action_dispatch/routing/route_set.rb | 1 | ||||
-rw-r--r-- | actionpack/test/dispatch/routing/route_set_test.rb | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb index f51bee3b31..602d2b3944 100644 --- a/actionpack/lib/action_dispatch/routing/route_set.rb +++ b/actionpack/lib/action_dispatch/routing/route_set.rb @@ -287,6 +287,7 @@ module ActionDispatch } end + inner_options.symbolize_keys! result.merge!(inner_options) end end diff --git a/actionpack/test/dispatch/routing/route_set_test.rb b/actionpack/test/dispatch/routing/route_set_test.rb index c465d56bde..87d44064ea 100644 --- a/actionpack/test/dispatch/routing/route_set_test.rb +++ b/actionpack/test/dispatch/routing/route_set_test.rb @@ -80,6 +80,14 @@ module ActionDispatch assert_equal '/foo/1/bar/2', url_helpers.foo_bar_path(2, foo_id: 1) end + test "stringified controller and action keys are properly symbolized" do + draw do + root 'foo#bar' + end + + assert_equal '/', url_helpers.root_path('controller' => 'foo', 'action' => 'bar') + end + private def draw(&block) @set.draw(&block) |