Quick question - access attributes through form helper?

3 views
Skip to first unread message

Mark Dixon

unread,
Jun 1, 2009, 8:41:53 AM6/1/09
to rubyonra...@googlegroups.com
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]
--
Posted via http://www.ruby-forum.com/.
Reply all
Reply to author
Forward
0 new messages