Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix typos and improve AC::StrongParameters documentation [ci skip]

  • Loading branch information...
commit 00da7c605dc99fd9bcc714e836308becd842a9d1 1 parent 3759e32
Francesco Rodriguez authored
Showing with 8 additions and 6 deletions.
  1. +8 −6 actionpack/lib/action_controller/metal/strong_parameters.rb
View
14 actionpack/lib/action_controller/metal/strong_parameters.rb
@@ -271,9 +271,9 @@ def each_element(object)
# == Strong Parameters
#
- # It provides an interface for proctecting attributes from end-user
- # assignment. This makes Action Controller parameters are forbidden
- # to be used in Active Model mass assignmets until they have been
+ # It provides an interface for protecting attributes from end-user
+ # assignment. This makes Action Controller parameters forbidden
+ # to be used in Active Model mass assignment until they have been
# whitelisted.
#
# In addition, parameters can be marked as required and flow through a
@@ -281,10 +281,12 @@ def each_element(object)
# effort.
#
# class PeopleController < ActionController::Base
- # # This will raise an ActiveModel::ForbiddenAttributes exception because
- # # it's using mass assignment without an explicit permit step.
+ # # Using "Person.create(params[:person])" would raise an
+ # # ActiveModel::ForbiddenAttributes exception because it'd
+ # # be using mass assignment without an explicit permit step.
+ # # This is the recommended form:
# def create
- # Person.create(params[:person])
+ # Person.create(person_params)
# end
#
# # This will pass with flying colors as long as there's a person key in the
Please sign in to comment.
Something went wrong with that request. Please try again.