# :attr\_accessible to protect all attributes

**URL:** <https://www.ruby-forum.com/t/attr-accessible-to-protect-all-attributes/156472>\
**Category:** Rails\
**Created:** [December 28, 2008, 5:14pm UTC](https://www.ruby-forum.com/t/attr-accessible-to-protect-all-attributes/156472 "2008-12-28T17:14:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fipa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/9e8a1a/32.png) [@fipa](https://www.ruby-forum.com/u/fipa)\
**Post date:** [December 28, 2008, 5:14pm UTC](https://www.ruby-forum.com/t/attr-accessible-to-protect-all-attributes/156472/1 "2008-12-28T17:14:58Z")

</div>

Hi,

I would like to protect all the attributes of one of my model. This  
ticket talks about this issue: [http://dev.rubyonrails.org/ticket/9631](http://dev.rubyonrails.org/ticket/9631) ,  
and a patch to the documentation was submitted:  
[http://dev.rubyonrails.org/changeset/8032](http://dev.rubyonrails.org/changeset/8032) , which actually states that  
defining :attr\_accessible alone, means all attributes are protected.

However when I look at the rails API page for attr\_accessible, I can’t  
find the documentation about that:

> **[ActiveRecord::Base](https://api.rubyonrails.org/classes/ActiveRecord/Base.html#M001981)**
>
> Active Record Active Record objects don't specify their attributes directly, but rather infer them from the table definition with which they're linked.

As of Rails 2.2.2, how do I protect all attributes of my model?

Best regards,
