Skip to content
This repository
Browse code

remove some non-breaking spaces [ci skip]

  • Loading branch information...
commit f069ec162fe92523eb5f0e8c0139005fed671a0c 1 parent f12244b
Francesco Rodríguez frodsan authored

Showing 1 changed file with 13 additions and 13 deletions. Show diff stats Hide diff stats

  1. +13 13 actionpack/lib/action_controller/metal/strong_parameters.rb
26 actionpack/lib/action_controller/metal/strong_parameters.rb
@@ -106,7 +106,7 @@ def permitted?
106 106 # end
107 107 #
108 108 # params = ActionController::Parameters.new(name: 'Francesco')
109   - # params.permitted? # => false
  109 + # params.permitted? # => false
110 110 # Person.new(params) # => ActiveModel::ForbiddenAttributesError
111 111 # params.permit!
112 112 # params.permitted? # => true
@@ -125,7 +125,7 @@ def permit!
125 125 # the parameter at the given +key+, otherwise raises an
126 126 # <tt>ActionController::ParameterMissing</tt> error.
127 127 #
128   - # ActionController::Parameters.new(person: { name: 'Francesco' }).require(:person)
  128 + # ActionController::Parameters.new(person: { name: 'Francesco' }).require(:person)
129 129 # # => {"name"=>"Francesco"}
130 130 #
131 131 # ActionController::Parameters.new(person: nil).require(:person)
@@ -141,13 +141,13 @@ def require(key)
141 141 alias :required :require
142 142
143 143 # Returns a new <tt>ActionController::Parameters</tt> instance that
144   - # includes only the given +filters+ and sets the +permitted+ for the
145   - # object to +true+. This is useful for limiting which attributes
  144 + # includes only the given +filters+ and sets the +permitted+ for the
  145 + # object to +true+. This is useful for limiting which attributes
146 146 # should be allowed for mass updating.
147 147 #
148 148 # params = ActionController::Parameters.new(user: { name: 'Francesco', age: 22, role: 'admin' })
149 149 # permitted = params.require(:user).permit(:name, :age)
150   - # permitted.permitted? # => true
  150 + # permitted.permitted? # => true
151 151 # permitted.has_key?(:name) # => true
152 152 # permitted.has_key?(:age) # => true
153 153 # permitted.has_key?(:role) # => false
@@ -155,7 +155,7 @@ def require(key)
155 155 # You can also use +permit+ on nested parameters, like:
156 156 #
157 157 # params = ActionController::Parameters.new({
158   - # person: {
  158 + # person: {
159 159 # name: 'Francesco',
160 160 # age: 22,
161 161 # pets: [{
@@ -168,7 +168,7 @@ def require(key)
168 168 # permitted = params.permit(person: [ :name, { pets: :name } ])
169 169 # permitted.permitted? # => true
170 170 # permitted[:person][:name] # => "Francesco"
171   - # permitted[:person][:age] # => nil
  171 + # permitted[:person][:age] # => nil
172 172 # permitted[:person][:pets][0][:name] # => "Purplish"
173 173 # permitted[:person][:pets][0][:category] # => nil
174 174 def permit(*filters)
@@ -204,7 +204,7 @@ def permit(*filters)
204 204 # returns +nil+.
205 205 #
206 206 # params = ActionController::Parameters.new(person: { name: 'Francesco' })
207   - # params[:person] # => {"name"=>"Francesco"}
  207 + # params[:person] # => {"name"=>"Francesco"}
208 208 # params[:none] # => nil
209 209 def [](key)
210 210 convert_hashes_to_parameters(key, super)
@@ -217,10 +217,10 @@ def [](key)
217 217 # is given, then that will be run and its result returned.
218 218 #
219 219 # params = ActionController::Parameters.new(person: { name: 'Francesco' })
220   - # params.fetch(:person) # => {"name"=>"Francesco"}
221   - # params.fetch(:none) # => ActionController::ParameterMissing: param not found: none
  220 + # params.fetch(:person) # => {"name"=>"Francesco"}
  221 + # params.fetch(:none) # => ActionController::ParameterMissing: param not found: none
222 222 # params.fetch(:none, 'Francesco') # => "Francesco"
223   - # params.fetch(:none) { 'Francesco' } # => "Francesco"
  223 + # params.fetch(:none) { 'Francesco' } # => "Francesco"
224 224 def fetch(key, *args)
225 225 convert_hashes_to_parameters(key, super)
226 226 rescue KeyError
@@ -278,7 +278,7 @@ def each_element(object)
278 278 # == Strong \Parameters
279 279 #
280 280 # It provides an interface for protecting attributes from end-user
281   - # assignment. This makes Action Controller parameters forbidden
  281 + # assignment. This makes Action Controller parameters forbidden
282 282 # to be used in Active Model mass assignment until they have been
283 283 # whitelisted.
284 284 #
@@ -307,7 +307,7 @@ def each_element(object)
307 307 #
308 308 # private
309 309 # # Using a private method to encapsulate the permissible parameters is
310   - # # just a good pattern since you'll be able to reuse the same permit
  310 + # # just a good pattern since you'll be able to reuse the same permit
311 311 # # list between create and update. Also, you can specialize this method
312 312 # # with per-user checking of permissible attributes.
313 313 # def person_params

0 comments on commit f069ec1

Please sign in to comment.
Something went wrong with that request. Please try again.