# Get attributes of model which are accessible?

**URL:** <https://www.ruby-forum.com/t/get-attributes-of-model-which-are-accessible/90902>\
**Category:** Rails\
**Created:** [April 2, 2007, 9:43pm UTC](https://www.ruby-forum.com/t/get-attributes-of-model-which-are-accessible/90902 "2007-04-02T21:43:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![josh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/45deac/32.png) [@josh](https://www.ruby-forum.com/u/josh)\
**Post date:** [April 2, 2007, 9:43pm UTC](https://www.ruby-forum.com/t/get-attributes-of-model-which-are-accessible/90902/1 "2007-04-02T21:43:02Z")

</div>

Hi all

I like to make all my model’s attributes not accessible by default so  
they are safe.  
But now I needed more than an hour to track a bug down to the fact, that  
a new attribute has not been set to accessible yet, so I thought about  
how I could inform me in development mode when a parameter for a model  
is sent by a form that is meant for a not accessible attribute.

So I need some way to determine if an attribute is accessible or not…  
How can I do this?

Thanks  
Josh

---

<div class="post-metadata">

**Author:** ![josh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/45deac/32.png) [@josh](https://www.ruby-forum.com/u/josh)\
**Post date:** [April 2, 2007, 11:58pm UTC](https://www.ruby-forum.com/t/get-attributes-of-model-which-are-accessible/90902/2 "2007-04-02T23:58:06Z")

</div>

Joshua M. wrote:

> Hi all
> 
> I like to make all my model’s attributes not accessible by default so  
> they are safe.  
> But now I needed more than an hour to track a bug down to the fact, that  
> a new attribute has not been set to accessible yet, so I thought about  
> how I could inform me in development mode when a parameter for a model  
> is sent by a form that is meant for a not accessible attribute.
> 
> So I need some way to determine if an attribute is accessible or not…  
> How can I do this?
> 
> Thanks  
> Josh

you make array of attributes which form can get access to.  
then you use mail to inform you whenever a attribute is trying to  
connect which have no access 🙂

Understand what I mean?
