# Quick question - access attributes through form helper?

**URL:** <https://www.ruby-forum.com/t/quick-question-access-attributes-through-form-helper/169253>\
**Category:** Rails\
**Created:** [June 1, 2009, 2:41pm UTC](https://www.ruby-forum.com/t/quick-question-access-attributes-through-form-helper/169253 "2009-06-01T14:41:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mdaoust](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/dbc845/32.png) [@mdaoust](https://www.ruby-forum.com/u/mdaoust)\
**Post date:** [June 1, 2009, 2:41pm UTC](https://www.ruby-forum.com/t/quick-question-access-attributes-through-form-helper/169253/1 "2009-06-01T14:41:53Z")

</div>

So within a form\_for/fields\_for can I access the field attributes.

[code=ruby]\<%= form.text\_field :name %\>#gives me a text box with the  
value of :name %\>  
\<%= form.label :name %\>#gives me a label with ‘name’ when I need the  
value of :name %\>

# Can I also do something

\<%= form.text\_field :category %\>#gives me a text box with true or false  
%\>  
\<% if :category %\> # access an attribute in this way in order to affect  
condition??[/code]
