From e8b26258d0365d57f51eb81b7162fe576da5f6da Mon Sep 17 00:00:00 2001 From: Steve Klabnik Date: Thu, 29 Nov 2012 04:02:51 -0800 Subject: Getting Started: remove reference to attr_accessible --- guides/source/getting_started.md | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'guides/source') 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 ``` -- cgit v1.2.3