# Attr\_accessor help understanding

**URL:** <https://www.ruby-forum.com/t/attr-accessor-help-understanding/101423>\
**Category:** Rails\
**Created:** [February 5, 2006, 11:15pm UTC](https://www.ruby-forum.com/t/attr-accessor-help-understanding/101423 "2006-02-05T23:15:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![aftershock](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/8e7dd6/32.png) [@aftershock](https://www.ruby-forum.com/u/aftershock)\
**Post date:** [February 5, 2006, 11:15pm UTC](https://www.ruby-forum.com/t/attr-accessor-help-understanding/101423/1 "2006-02-05T23:15:27Z")

</div>

i’m having trouble understanding the attr\_accessor and attr\_accessible  
syntax in models. I’m workink through the Agile book and even a look at  
the ruby doc does not really help to clarify.

Thanks aftershock

---

<div class="post-metadata">

**Author:** ![aftershock](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/8e7dd6/32.png) [@aftershock](https://www.ruby-forum.com/u/aftershock)\
**Post date:** [February 5, 2006, 11:20pm UTC](https://www.ruby-forum.com/t/attr-accessor-help-understanding/101423/2 "2006-02-05T23:20:21Z")

</div>

Could you give an example that gives you trouble, or a page number?

---

<div class="post-metadata">

**Author:** ![aftershock](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/8e7dd6/32.png) [@aftershock](https://www.ruby-forum.com/u/aftershock)\
**Post date:** [February 5, 2006, 11:28pm UTC](https://www.ruby-forum.com/t/attr-accessor-help-understanding/101423/3 "2006-02-05T23:28:09Z")

</div>

anne g wrote:

> Could you give an example that gives you trouble, or a page number?

It was just a general question but I was working on page 128 of the  
Agile book.

---

<div class="post-metadata">

**Author:** ![aftershock](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/8e7dd6/32.png) [@aftershock](https://www.ruby-forum.com/u/aftershock)\
**Post date:** [February 5, 2006, 11:44pm UTC](https://www.ruby-forum.com/t/attr-accessor-help-understanding/101423/4 "2006-02-05T23:44:36Z")

</div>

[http://railsmanual.org/class/ActiveRecord::Base/attr\_accessible](http://railsmanual.org/class/ActiveRecord::Base/attr_accessible)

attr\_accessible is not something I am familiar with

[http://www.phylomortis.com/resource/script/syntax/syn-aa.html](http://www.phylomortis.com/resource/script/syntax/syn-aa.html)  
this seems to be regular ruby stuff, being able to access an object  
variable from outside the object definition
