Browse files

update AC::ParameterMissing documentation [ci skip]

  • Loading branch information...
1 parent 19a41eb commit 2aacee15248ae358387835e9d7829082cf5c485d Francesco Rodriguez committed Sep 18, 2012
Showing with 9 additions and 2 deletions.
  1. +9 −2 actionpack/lib/action_controller/metal/strong_parameters.rb
View
11 actionpack/lib/action_controller/metal/strong_parameters.rb
@@ -3,10 +3,17 @@
require 'active_support/rescuable'
module ActionController
+ # Raised when a required parameter is missing.
+ #
+ # params = ActionController::Parameters.new(a: {})
+ # params.fetch(:b)
+ # # => ActionController::ParameterMissing: key not found: b
+ # params.require(:a)
+ # # => ActionController::ParameterMissing: key not found: a
class ParameterMissing < KeyError
- attr_reader :param
+ attr_reader :param # :nodoc:
- def initialize(param)
+ def initialize(param) # :nodoc:
@param = param
super("key not found: #{param}")
end

0 comments on commit 2aacee1

Please sign in to comment.