diff options
author | Francesco Rodriguez <lrodriguezsanc@gmail.com> | 2012-12-10 19:07:25 -0500 |
---|---|---|
committer | Francesco Rodriguez <lrodriguezsanc@gmail.com> | 2012-12-10 19:07:25 -0500 |
commit | 1e83730067709d8c07fd25669088e8e9efd2355b (patch) | |
tree | a4f80af4b97313d8c68c9220d7f721b06fadfe78 | |
parent | 46d63d5b209e170687860ce4122b07070342c3ba (diff) | |
download | rails-1e83730067709d8c07fd25669088e8e9efd2355b.tar.gz rails-1e83730067709d8c07fd25669088e8e9efd2355b.tar.bz2 rails-1e83730067709d8c07fd25669088e8e9efd2355b.zip |
remove Mass Assignment reference from Form Helpers guide [ci skip]
-rw-r--r-- | guides/source/form_helpers.md | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/guides/source/form_helpers.md b/guides/source/form_helpers.md index ee563e72d5..8ab44ea0bb 100644 --- a/guides/source/form_helpers.md +++ b/guides/source/form_helpers.md @@ -458,7 +458,7 @@ As with other helpers, if you were to use the `select` helper on a form builder <%= f.select(:city_id, ...) %> ``` -WARNING: If you are using `select` (or similar helpers such as `collection_select`, `select_tag`) to set a `belongs_to` association you must pass the name of the foreign key (in the example above `city_id`), not the name of association itself. If you specify `city` instead of `city_id` Active Record will raise an error along the lines of ` ActiveRecord::AssociationTypeMismatch: City(#17815740) expected, got String(#1138750) ` when you pass the `params` hash to `Person.new` or `update_attributes`. Another way of looking at this is that form helpers only edit attributes. You should also be aware of the potential security ramifications of allowing users to edit foreign keys directly. You may wish to consider the use of `attr_protected` and `attr_accessible`. For further details on this, see the [Ruby On Rails Security Guide](security.html#mass-assignment). +WARNING: If you are using `select` (or similar helpers such as `collection_select`, `select_tag`) to set a `belongs_to` association you must pass the name of the foreign key (in the example above `city_id`), not the name of association itself. If you specify `city` instead of `city_id` Active Record will raise an error along the lines of ` ActiveRecord::AssociationTypeMismatch: City(#17815740) expected, got String(#1138750) ` when you pass the `params` hash to `Person.new` or `update_attributes`. Another way of looking at this is that form helpers only edit attributes. You should also be aware of the potential security ramifications of allowing users to edit foreign keys directly. ### Option Tags from a Collection of Arbitrary Objects |