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


Reply via email to