aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source
diff options
context:
space:
mode:
authorSteve Klabnik <steve@steveklabnik.com>2012-11-29 04:02:51 -0800
committerSteve Klabnik <steve@steveklabnik.com>2012-11-29 04:06:08 -0800
commite8b26258d0365d57f51eb81b7162fe576da5f6da (patch)
treeb543c2aa970f8bb938d6e95fe683695162f06b59 /guides/source
parent8bc945da5f23e2961eab633c4e8beb6b078b043f (diff)
downloadrails-e8b26258d0365d57f51eb81b7162fe576da5f6da.tar.gz
rails-e8b26258d0365d57f51eb81b7162fe576da5f6da.tar.bz2
rails-e8b26258d0365d57f51eb81b7162fe576da5f6da.zip
Getting Started: remove reference to attr_accessible
Diffstat (limited to 'guides/source')
-rw-r--r--guides/source/getting_started.md11
1 files changed, 0 insertions, 11 deletions
diff --git a/guides/source/getting_started.md b/guides/source/getting_started.md
index e4e65d99d2..d181bed424 100644
--- a/guides/source/getting_started.md
+++ b/guides/source/getting_started.md
@@ -693,7 +693,6 @@ 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
```
@@ -703,12 +702,6 @@ 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. 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
Rails includes methods to help you validate the data that you send to models.
@@ -716,8 +709,6 @@ Open the `app/models/post.rb` file and edit it:
```ruby
class Post < ActiveRecord::Base
- attr_accessible :text, :title
-
validates :title, presence: true,
length: { minimum: 5 }
end
@@ -1229,7 +1220,6 @@ First, take a look at `comment.rb`:
```ruby
class Comment < ActiveRecord::Base
belongs_to :post
- attr_accessible :body, :commenter
end
```
@@ -1292,7 +1282,6 @@ makes each comment belong to a Post:
```ruby
class Comment < ActiveRecord::Base
belongs_to :post
- attr_accessible :body, :commenter
end
```