aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Wesselhoeft <christian.wesselhoeft@gmail.com>2016-05-29 07:34:25 -0600
committerChristian Wesselhoeft <christian.wesselhoeft@gmail.com>2016-05-29 07:34:25 -0600
commit1f36f02dfd8638e30be0716af5cc5b7fef8b6fe3 (patch)
treed1a7f48ee94e163c915d013f9e7ef406c260b3b8
parent28750a622519f8897a12cacf5bb163059b511669 (diff)
downloadrails-1f36f02dfd8638e30be0716af5cc5b7fef8b6fe3.tar.gz
rails-1f36f02dfd8638e30be0716af5cc5b7fef8b6fe3.tar.bz2
rails-1f36f02dfd8638e30be0716af5cc5b7fef8b6fe3.zip
ActionController::Parameters: Fix #dig doc code
This example code wasn't getting wrapped in a `<code>` tag due to incorrect indentation.
-rw-r--r--actionpack/lib/action_controller/metal/strong_parameters.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/actionpack/lib/action_controller/metal/strong_parameters.rb b/actionpack/lib/action_controller/metal/strong_parameters.rb
index a0579221c7..46589901fd 100644
--- a/actionpack/lib/action_controller/metal/strong_parameters.rb
+++ b/actionpack/lib/action_controller/metal/strong_parameters.rb
@@ -441,12 +441,12 @@ module ActionController
# Extracts the nested parameter from the given +keys+ by calling +dig+
# at each step. Returns +nil+ if any intermediate step is +nil+.
#
- # params = ActionController::Parameters.new(foo: { bar: { baz: 1 } })
- # params.dig(:foo, :bar, :baz) # => 1
- # params.dig(:foo, :zot, :xyz) # => nil
+ # params = ActionController::Parameters.new(foo: { bar: { baz: 1 } })
+ # params.dig(:foo, :bar, :baz) # => 1
+ # params.dig(:foo, :zot, :xyz) # => nil
#
- # params2 = ActionController::Parameters.new(foo: [10, 11, 12])
- # params2.dig(:foo, 1) # => 11
+ # params2 = ActionController::Parameters.new(foo: [10, 11, 12])
+ # params2.dig(:foo, 1) # => 11
def dig(*keys)
convert_value_to_parameters(@parameters.dig(*keys))
end