@@ -81,7 +81,7 @@ def initialize # :nodoc:
81
81
# })
82
82
#
83
83
# permitted = params.require(:person).permit(:name, :age)
84
- # permitted # => <ActionController::Parameters {"name"=>"Francesco", "age"=>22} permitted: true>
84
+ # permitted # => # <ActionController::Parameters {"name"=>"Francesco", "age"=>22} permitted: true>
85
85
# permitted.permitted? # => true
86
86
#
87
87
# Person.first.update!(permitted)
@@ -111,7 +111,7 @@ def initialize # :nodoc:
111
111
#
112
112
# params = ActionController::Parameters.new(a: "123", b: "456")
113
113
# params.permit(:c)
114
- # # => <ActionController::Parameters {} permitted: true>
114
+ # # => # <ActionController::Parameters {} permitted: true>
115
115
#
116
116
# ActionController::Parameters.action_on_unpermitted_parameters = :raise
117
117
#
@@ -442,7 +442,7 @@ def permit!
442
442
# either present or the singleton +false+, returns said value:
443
443
#
444
444
# ActionController::Parameters.new(person: { name: "Francesco" }).require(:person)
445
- # # => <ActionController::Parameters {"name"=>"Francesco"} permitted: false>
445
+ # # => # <ActionController::Parameters {"name"=>"Francesco"} permitted: false>
446
446
#
447
447
# Otherwise raises <tt>ActionController::ParameterMissing</tt>:
448
448
#
@@ -570,13 +570,13 @@ def require(key)
570
570
# })
571
571
#
572
572
# params.require(:person).permit(:contact)
573
- # # => <ActionController::Parameters {} permitted: true>
573
+ # # => # <ActionController::Parameters {} permitted: true>
574
574
#
575
575
# params.require(:person).permit(contact: :phone)
576
- # # => <ActionController::Parameters {"contact"=><ActionController::Parameters {"phone"=>"555-1234"} permitted: true>} permitted: true>
576
+ # # => # <ActionController::Parameters {"contact"=># <ActionController::Parameters {"phone"=>"555-1234"} permitted: true>} permitted: true>
577
577
#
578
578
# params.require(:person).permit(contact: [ :email, :phone ])
579
- # # => <ActionController::Parameters {"contact"=><ActionController::Parameters {"email"=>"[email protected] ", "phone"=>"555-1234"} permitted: true>} permitted: true>
579
+ # # => # <ActionController::Parameters {"contact"=># <ActionController::Parameters {"email"=>"[email protected] ", "phone"=>"555-1234"} permitted: true>} permitted: true>
580
580
#
581
581
# If your parameters specify multiple parameters indexed by a number,
582
582
# you can permit each set of parameters under the numeric key to be the same using the same syntax as permitting a single item.
@@ -633,7 +633,7 @@ def permit(*filters)
633
633
# returns +nil+.
634
634
#
635
635
# params = ActionController::Parameters.new(person: { name: "Francesco" })
636
- # params[:person] # => <ActionController::Parameters {"name"=>"Francesco"} permitted: false>
636
+ # params[:person] # => # <ActionController::Parameters {"name"=>"Francesco"} permitted: false>
637
637
# params[:none] # => nil
638
638
def []( key )
639
639
convert_hashes_to_parameters ( key , @parameters [ key ] )
@@ -653,9 +653,9 @@ def []=(key, value)
653
653
# is given, then that will be run and its result returned.
654
654
#
655
655
# params = ActionController::Parameters.new(person: { name: "Francesco" })
656
- # params.fetch(:person) # => <ActionController::Parameters {"name"=>"Francesco"} permitted: false>
656
+ # params.fetch(:person) # => # <ActionController::Parameters {"name"=>"Francesco"} permitted: false>
657
657
# params.fetch(:none) # => ActionController::ParameterMissing: param is missing or the value is empty: none
658
- # params.fetch(:none, {}) # => <ActionController::Parameters {} permitted: false>
658
+ # params.fetch(:none, {}) # => # <ActionController::Parameters {} permitted: false>
659
659
# params.fetch(:none, "Francesco") # => "Francesco"
660
660
# params.fetch(:none) { "Francesco" } # => "Francesco"
661
661
def fetch ( key , *args )
@@ -689,8 +689,8 @@ def dig(*keys)
689
689
# don't exist, returns an empty hash.
690
690
#
691
691
# params = ActionController::Parameters.new(a: 1, b: 2, c: 3)
692
- # params.slice(:a, :b) # => <ActionController::Parameters {"a"=>1, "b"=>2} permitted: false>
693
- # params.slice(:d) # => <ActionController::Parameters {} permitted: false>
692
+ # params.slice(:a, :b) # => # <ActionController::Parameters {"a"=>1, "b"=>2} permitted: false>
693
+ # params.slice(:d) # => # <ActionController::Parameters {} permitted: false>
694
694
def slice ( *keys )
695
695
new_instance_with_inherited_permitted_status ( @parameters . slice ( *keys ) )
696
696
end
@@ -706,17 +706,17 @@ def slice!(*keys)
706
706
# filters out the given +keys+.
707
707
#
708
708
# params = ActionController::Parameters.new(a: 1, b: 2, c: 3)
709
- # params.except(:a, :b) # => <ActionController::Parameters {"c"=>3} permitted: false>
710
- # params.except(:d) # => <ActionController::Parameters {"a"=>1, "b"=>2, "c"=>3} permitted: false>
709
+ # params.except(:a, :b) # => # <ActionController::Parameters {"c"=>3} permitted: false>
710
+ # params.except(:d) # => # <ActionController::Parameters {"a"=>1, "b"=>2, "c"=>3} permitted: false>
711
711
def except ( *keys )
712
712
new_instance_with_inherited_permitted_status ( @parameters . except ( *keys ) )
713
713
end
714
714
715
715
# Removes and returns the key/value pairs matching the given keys.
716
716
#
717
717
# params = ActionController::Parameters.new(a: 1, b: 2, c: 3)
718
- # params.extract!(:a, :b) # => <ActionController::Parameters {"a"=>1, "b"=>2} permitted: false>
719
- # params # => <ActionController::Parameters {"c"=>3} permitted: false>
718
+ # params.extract!(:a, :b) # => # <ActionController::Parameters {"a"=>1, "b"=>2} permitted: false>
719
+ # params # => # <ActionController::Parameters {"c"=>3} permitted: false>
720
720
def extract! ( *keys )
721
721
new_instance_with_inherited_permitted_status ( @parameters . extract! ( *keys ) )
722
722
end
@@ -726,7 +726,7 @@ def extract!(*keys)
726
726
#
727
727
# params = ActionController::Parameters.new(a: 1, b: 2, c: 3)
728
728
# params.transform_values { |x| x * 2 }
729
- # # => <ActionController::Parameters {"a"=>2, "b"=>4, "c"=>6} permitted: false>
729
+ # # => # <ActionController::Parameters {"a"=>2, "b"=>4, "c"=>6} permitted: false>
730
730
def transform_values
731
731
return to_enum ( :transform_values ) unless block_given?
732
732
new_instance_with_inherited_permitted_status (
0 commit comments