aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorGaurish Sharma <contact@gaurishsharma.com>2016-03-12 13:33:08 +0530
committerGaurish Sharma <contact@gaurishsharma.com>2016-03-12 13:33:08 +0530
commit8b44687e9e12191964c0f4078d8b6552e3cc9b87 (patch)
tree286e51f4a407a2fe2c069d2bc7fdc7f8417f23be /actionpack/lib
parent598816f630aadc5f63c8e36bc16accd6e15d4fb0 (diff)
downloadrails-8b44687e9e12191964c0f4078d8b6552e3cc9b87.tar.gz
rails-8b44687e9e12191964c0f4078d8b6552e3cc9b87.tar.bz2
rails-8b44687e9e12191964c0f4078d8b6552e3cc9b87.zip
Add example for ActionController::Parameters#to_unsafe_h
[ci-skip]
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_controller/metal/strong_parameters.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/actionpack/lib/action_controller/metal/strong_parameters.rb b/actionpack/lib/action_controller/metal/strong_parameters.rb
index a01110d474..bb7ec97e9e 100644
--- a/actionpack/lib/action_controller/metal/strong_parameters.rb
+++ b/actionpack/lib/action_controller/metal/strong_parameters.rb
@@ -184,6 +184,13 @@ module ActionController
# Returns an unsafe, unfiltered
# <tt>ActiveSupport::HashWithIndifferentAccess</tt> representation of this
# parameter.
+ #
+ # params = ActionController::Parameters.new({
+ # name: 'Senjougahara Hitagi',
+ # oddity: 'Heavy stone crab'
+ # })
+ # params.to_unsafe_h
+ # # => {"name"=>"Senjougahara Hitagi", oddity" => "Heavy stone crab"}
def to_unsafe_h
convert_parameters_to_hashes(@parameters, :to_unsafe_h)
end