Rather then using text_field_for, you should use the syntax favoured by
Rails 2.0 (which I presume you''re using)--start your form with:
form_for(@article) do |f|
Then you can write things like this:
f.text_field :title # creates a text-field mapped to the title attribute
of the model
f.check_box :is_published
f.submit "Register Me!"
And, of course, the one you asked for:
f.text_area :comments, :cols => 60
Best of all, Rails will handle the mapping to the model, and even
putting in data (say, when you edit the form)
I wrote an article on forms in Rails here:
http://www.railsrocket.com/sharing-new-and-edit-forms-with-partials
it''s
more geared towards sharing the new and edit forms, but hopefully will
provide some clarity :)
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---