instance method
dup
Ruby on Rails 4.2.9
Since v4.0.13 Last seen in v4.2.9Signature
dup()
Returns an exact copy of the ActionController::Parameters instance. permitted state is kept on the duped object.
params = ActionController::Parameters.new(a: 1) params.permit! params.permitted? # => true copy_params = params.dup # => {"a"=>1} copy_params.permitted? # => true
Source
# File actionpack/lib/action_controller/metal/strong_parameters.rb, line 437
def dup
super.tap do |duplicate|
duplicate.permitted = @permitted
end
end
Defined in actionpack/lib/action_controller/metal/strong_parameters.rb line 437
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionController::Parameters