Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #8803 from frodsan/sp_docs

Improve StrongParameters documentation [ci skip]
  • Loading branch information...
commit efbb041fb0146d5f633c2e645217f3a734539f11 2 parents 1ce304f + 2aa08e3
@carlosantoniodasilva carlosantoniodasilva authored
Showing with 7 additions and 8 deletions.
  1. +7 −8 actionpack/lib/action_controller/metal/strong_parameters.rb
View
15 actionpack/lib/action_controller/metal/strong_parameters.rb
@@ -25,9 +25,9 @@ def initialize(param) # :nodoc:
# params.permit(:c)
# # => ActionController::UnpermittedParameters: found unpermitted keys: a, b
class UnpermittedParameters < IndexError
- attr_reader :params
+ attr_reader :params # :nodoc:
- def initialize(params)
+ def initialize(params) # :nodoc:
@params = params
super("found unpermitted keys: #{params.join(", ")}")
end
@@ -60,12 +60,11 @@ def initialize(params)
# It provides two options that controls the top-level behavior of new instances:
#
# * +permit_all_parameters+ - If it's +true+, all the parameters will be
- # permitted by default. The default value for +permit_all_parameters+
- # option is +false+.
- # * +raise_on_unpermitted_parameters+ - If it's +true+, it will raise an exception
- # if parameters that are not explicitly permitted are found. The default value for
- # +raise_on_unpermitted_parameters+ # option is +true+ in test and development
- # environments, +false+ otherwise.
+ # permitted by default. The default is +false+.
+ # * +raise_on_unpermitted_parameters+ - If it's +true+, it will raise an
+ # ActionController::UnpermittedParameters exception if parameters that are not
+ # explicitly permitted are found. The default value is +true+ in test and
+ # development environments, +false+ otherwise.
#
# params = ActionController::Parameters.new
# params.permitted? # => false
Please sign in to comment.
Something went wrong with that request. Please try again.