Hi Todd,

I was able to get the form to render properly.  I'm still unclear
about how to set the values of the field_for fields and access them in
the controller code.  When I use the following code, only one form
value is getting submitted.

<% form_tag do %>
 <% @people.each do |person| %>
   <% fields_for(person) do |f| %>
     <div>
       <%= person.name %>:
       <%= f.text_field :age %>
     </div>
     <% end %>
   <% end %>
 <%= submit_tag %>
<% end %>

Thanks,
Raj


On Nov 19, 10:03 pm, raji <dheer...@gmail.com> wrote:
> Hi Todd,
>
> Thanks for the help.
>
> I'm getting the following message:
>
> undefined method `person_person_person_path'
>
> On Nov 18, 11:01 pm, "Todd A. Jacobs" <tjacobs-sndr-
>
> b4f...@codegnome.org> wrote:
> > On Wed, Nov 18, 2009 at 10:41:16PM -0800, raji wrote:
> > > <% for person in @people %>
> > >   <div>
> > >     <span><%= person.name %>:</span>
> > >     <span><%= text_field :person, :gender %></span>
> > >   </div>
> > > <% end %>
>
> > If you are okay with mass assignment, do this instead:
>
> >     <% form_for(@people) do |person| %>
> >         <% fields_for(person) do |f| %>
> >             <!-- form fields go here -->
> >         <% end %>
> >     <% end %>
>
> > Of course, your create method will need to handle multiple records too,
> > rather than the defaults created by scaffolding.
>
> > --
> > "Oh, look: rocks!"
> >         -- Doctor Who, "Destiny of the Daleks"

--

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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=.


Reply via email to