Can someone explain what is the correct way with Rails 1.2 to use a form
to
create an object.
I know start_form_tag is changed to form_tag but what about form_for?
I am trying to map a field on to field in the object which is created by
a
method call,
so something like this def password=(pass) and so on. However, this
seems to
work fine for me
in some cases but not in others.
Both take blocks now. When using form_for, supply the block with a
symbol denoting the corresponding object, then you don’t have to
restate it everyplace:
<% form_for :people do |f| %>
name
<%= f.text_field :name %>
address
<%= f.text_field :address %>
<% end %>
In particular, this is great when there are multiple forms on the
same page. You specify:
Is there a ‘correct’ approach for this. Rails seems to allow me to set
up forms in
a number of ways but I can find nothing that says this is the right
way to do it.
Keith
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.