# Conditional attr\_protected

**URL:** <https://www.ruby-forum.com/t/conditional-attr-protected/115558>\
**Category:** Rails\
**Created:** [September 26, 2007, 7:49am UTC](https://www.ruby-forum.com/t/conditional-attr-protected/115558 "2007-09-26T07:49:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![raker\_t](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ecae2f/32.png) [@raker\_t](https://www.ruby-forum.com/u/raker_t)\
**Post date:** [September 26, 2007, 7:49am UTC](https://www.ruby-forum.com/t/conditional-attr-protected/115558/1 "2007-09-26T07:49:57Z")

</div>

Hi all, first off, let me say I am new to the Rails framework. With that  
being said, please let me know if there is a better way of doing this.

I have a user object that contains some flags, is\_active being one of  
them. When I sign up a user, I don’t want someone to be able to set that  
field by hacking the form, so I was going to use attr\_protected.  
However, in the admin application, I would like that is\_active field to  
be able to be set. Is there a way to do this without having to check for  
that field before I save?

Let me know if there are any clarifications needed.

Thanks in advance.

- J
