# Attr\_accessible question

**URL:** <https://www.ruby-forum.com/t/attr-accessible-question/182497>\
**Category:** Rails\
**Created:** [January 28, 2010, 11:12pm UTC](https://www.ruby-forum.com/t/attr-accessible-question/182497 "2010-01-28T23:12:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![byrnejb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/d2c977/32.png) [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Post date:** [January 28, 2010, 11:12pm UTC](https://www.ruby-forum.com/t/attr-accessible-question/182497/1 "2010-01-28T23:12:06Z")

</div>

Can one vary which attributes are available for mass assignment ? In  
other words, if I had this statement in a model

attr\_accessible :a, 🅱, :c

is there some simple way to later add :d or remove :c?

---

<div class="post-metadata">

**Author:** ![byrnejb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/d2c977/32.png) [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Post date:** [January 29, 2010, 12:28am UTC](https://www.ruby-forum.com/t/attr-accessible-question/182497/2 "2010-01-29T00:28:21Z")

</div>

James B. wrote:

> Can one vary which attributes are available for mass assignment ? In  
> other words, if I had this statement in a model
> 
> attr\_accessible :a, 🅱, :c
> 
> is there some simple way to later add :d

Model.attr\_accessible :d

> or remove :c?

I’m not sure.

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![byrnejb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/d2c977/32.png) [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Post date:** [January 29, 2010, 4:58pm UTC](https://www.ruby-forum.com/t/attr-accessible-question/182497/3 "2010-01-29T16:58:02Z")

</div>

On Jan 28, 6:28 pm, Marnen Laibow-Koser [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > is there some simple way to later add :d
> 
> Model.attr\_accessible :d
> 
> > or remove :c?
> 
> I’m not sure.

So is attr\_accessible is a one-way trip? Is is the case that once an  
attribute is added to the attr\_accessible collection then there is no  
way to remove it? I have already discovered that one may not user  
attr\_protected if one has already called attr\_accessible.
