diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2013-01-07 15:09:31 -0800 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2013-01-07 15:09:31 -0800 |
commit | efbb041fb0146d5f633c2e645217f3a734539f11 (patch) | |
tree | 349169dabf06e65ca1d2996318f3c1cd0fdbd672 | |
parent | 1ce304f8165e4a930f1a8fb1f6706e61f6411096 (diff) | |
parent | 2aa08e313d3cc3562a3651977c428f7ca9182810 (diff) | |
download | rails-efbb041fb0146d5f633c2e645217f3a734539f11.tar.gz rails-efbb041fb0146d5f633c2e645217f3a734539f11.tar.bz2 rails-efbb041fb0146d5f633c2e645217f3a734539f11.zip |
Merge pull request #8803 from frodsan/sp_docs
Improve StrongParameters documentation [ci skip]
-rw-r--r-- | actionpack/lib/action_controller/metal/strong_parameters.rb | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/actionpack/lib/action_controller/metal/strong_parameters.rb b/actionpack/lib/action_controller/metal/strong_parameters.rb index a158e6dbae..5ea1b2cc1a 100644 --- a/actionpack/lib/action_controller/metal/strong_parameters.rb +++ b/actionpack/lib/action_controller/metal/strong_parameters.rb @@ -25,9 +25,9 @@ module ActionController # 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 @@ module ActionController # 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 |