@@ -7,15 +7,15 @@ module ActionController
7
7
#
8
8
# params = ActionController::Parameters.new(a: {})
9
9
# params.fetch(:b)
10
- # # => ActionController::ParameterMissing: key not found: b
10
+ # # => ActionController::ParameterMissing: param not found: b
11
11
# params.require(:a)
12
- # # => ActionController::ParameterMissing: key not found: a
12
+ # # => ActionController::ParameterMissing: param not found: a
13
13
class ParameterMissing < KeyError
14
14
attr_reader :param # :nodoc:
15
15
16
16
def initialize ( param ) # :nodoc:
17
17
@param = param
18
- super ( "key not found: #{ param } " )
18
+ super ( "param not found: #{ param } " )
19
19
end
20
20
end
21
21
@@ -124,10 +124,10 @@ def permit!
124
124
# # => {"name"=>"Francesco"}
125
125
#
126
126
# ActionController::Parameters.new(person: nil).require(:person)
127
- # # => ActionController::ParameterMissing: key not found: person
127
+ # # => ActionController::ParameterMissing: param not found: person
128
128
#
129
129
# ActionController::Parameters.new(person: {}).require(:person)
130
- # # => ActionController::ParameterMissing: key not found: person
130
+ # # => ActionController::ParameterMissing: param not found: person
131
131
def require ( key )
132
132
self [ key ] . presence || raise ( ParameterMissing . new ( key ) )
133
133
end
@@ -212,7 +212,7 @@ def [](key)
212
212
#
213
213
# params = ActionController::Parameters.new(person: { name: 'Francesco' })
214
214
# params.fetch(:person) # => {"name"=>"Francesco"}
215
- # params.fetch(:none) # => ActionController::ParameterMissing: key not found: none
215
+ # params.fetch(:none) # => ActionController::ParameterMissing: param not found: none
216
216
# params.fetch(:none, 'Francesco') # => "Francesco"
217
217
# params.fetch(:none) { 'Francesco' } # => "Francesco"
218
218
def fetch ( key , *args )
0 commit comments