diff options
author | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2017-03-06 08:30:41 +0900 |
---|---|---|
committer | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2017-03-06 08:33:39 +0900 |
commit | 0c1ff4243e40ff7535bfd348efa1888733599ab0 (patch) | |
tree | 27f41bb8e085da383eb55544873a27397dc72194 /actionpack | |
parent | 12038f6505cdbcdbea861c7ae5f272e918100e13 (diff) | |
download | rails-0c1ff4243e40ff7535bfd348efa1888733599ab0.tar.gz rails-0c1ff4243e40ff7535bfd348efa1888733599ab0.tar.bz2 rails-0c1ff4243e40ff7535bfd348efa1888733599ab0.zip |
Fix `direct` with params example [ci skip]
Since `ActionController:Parameters` does not inherit `Hash`, need to
explicitly convert it to `Hash`.
Also, `Parameters#to_h` returns `Hash` whose key is `String`. Therefore,
if merge as it is, the value will not be overwritten as expected.
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 2 |
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 6e06c70dc2..dea6c4482e 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -2054,7 +2054,7 @@ module ActionDispatch # your url helper definition, e.g: # # direct :browse, page: 1, size: 10 do |options| - # [ :products, options.merge(params.permit(:page, :size)) ] + # [ :products, options.merge(params.permit(:page, :size).to_h.symbolize_keys) ] # end # # In this instance the `params` object comes from the context in which the the |