HEX
Server: Apache
System: Linux s198.coreserver.jp 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC 2025 x86_64
User: nagasaki (10062)
PHP: 7.1.33
Disabled: NONE
Upload Files
File: //usr/local/rvm/gems/ruby-2.7.4/doc/actionpack-6.1.4.1/ri/ActionController/Parameters/require-i.ri
U:RDoc::AnyMethod[iI"require:ETI")ActionController::Parameters#require;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph;	[I"@This method accepts both a single key and an array of keys.;To:RDoc::Markup::BlankLineo;
;	[I"HWhen passed a single key, if it exists and its associated value is ;TI"Aeither present or the singleton +false+, returns said value:;T@o:RDoc::Markup::Verbatim;	[I"VActionController::Parameters.new(person: { name: "Francesco" }).require(:person)
;TI"P# => <ActionController::Parameters {"name"=>"Francesco"} permitted: false>
;T:@format0o;
;	[I"BOtherwise raises <tt>ActionController::ParameterMissing</tt>:;T@o;;	[I"7ActionController::Parameters.new.require(:person)
;TI"Z# ActionController::ParameterMissing: param is missing or the value is empty: person
;TI"
;TI"DActionController::Parameters.new(person: nil).require(:person)
;TI"Z# ActionController::ParameterMissing: param is missing or the value is empty: person
;TI"
;TI"EActionController::Parameters.new(person: "\t").require(:person)
;TI"Z# ActionController::ParameterMissing: param is missing or the value is empty: person
;TI"
;TI"CActionController::Parameters.new(person: {}).require(:person)
;TI"Z# ActionController::ParameterMissing: param is missing or the value is empty: person
;T;
0o;
;	[I"OWhen given an array of keys, the method tries to require each one of them ;TI"Min order. If it succeeds, an array with the respective return values is ;TI"returned:;T@o;;	[I"Pparams = ActionController::Parameters.new(user: { ... }, profile: { ... })
;TI"Euser_params, profile_params = params.require([:user, :profile])
;T;
0o;
;	[I"?Otherwise, the method re-raises the first exception found:;T@o;;	[I"Fparams = ActionController::Parameters.new(user: {}, profile: {})
;TI"Euser_params, profile_params = params.require([:user, :profile])
;TI"X# ActionController::ParameterMissing: param is missing or the value is empty: user
;T;
0o;
;	[I"BTechnically this method can be used to fetch terminal values:;T@o;;	[I"# CAREFUL
;TI"Iparams = ActionController::Parameters.new(person: { name: "Finn" })
;TI"=name = params.require(:person).require(:name) # CAREFUL
;T;
0o;
;	[I"Nbut take into account that at some point those ones have to be permitted:;T@o;;	[
I"def person_params
;TI"D  params.require(:person).permit(:name).tap do |person_params|
;TI".    person_params.require(:name) # SAFER
;TI"  end
;TI"	end
;T;
0o;
;	[I"for example.;T:
@fileI"5lib/action_controller/metal/strong_parameters.rb;T:0@omit_headings_from_table_of_contents_below000[[I"
required;To;;	[o;
;	[I"Alias of #require.;T;@M;0I"
(key);T@MFI"Parameters;TcRDoc::NormalClass00