Skip to content
Browse files

Modified "Allowing the update of fields" section

* Rails generate model Post ______ creates the
  attr_accessible line for you for any fields
  you specify. Changed the section to describe
  what this line in the model does.
  • Loading branch information...
1 parent c332393 commit 85db49fd8d7a14cc0126f1a2516effbea33d715f @jasonnoble jasonnoble committed Nov 24, 2012
Showing with 6 additions and 12 deletions.
  1. +6 −12 guides/source/getting_started.md
View
18 guides/source/getting_started.md
@@ -693,6 +693,7 @@ The model file, `app/models/post.rb` is about as simple as it can get:
```ruby
class Post < ActiveRecord::Base
+ attr_accessible :text, :title
end
```
@@ -702,18 +703,11 @@ your Rails models for free, including basic database CRUD (Create, Read, Update,
Destroy) operations, data validation, as well as sophisticated search support
and the ability to relate multiple models to one another.
-Rails includes methods to help you secure some of your model fields.
-Open the `app/models/post.rb` file and edit it:
-
-```ruby
-class Post < ActiveRecord::Base
- attr_accessible :text, :title
-end
-```
-
-This change will ensure that all changes made through HTML forms can edit the content of the text and title fields.
-It will not be possible to define any other field value through forms. You can still define them by calling the `field=` method of course.
-Accessible attributes and the mass assignment problem is covered in details in the [Security guide](security.html#mass-assignment)
+Rails includes methods to help you secure some of your model fields. The Rails
+model generator added the attr_accessible line to your model file. This change
+will ensure that all changes made through HTML forms can edit the content of
+the text and title fields. Accessible attributes and the mass assignment problem is covered in
+details in the [Security guide](security.html#mass-assignment)
### Adding Some Validation

0 comments on commit 85db49f

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