I''m using the following in a form_for, in order to display and edit
two activity_details in the same form as an activity.
<% fields_for "activity_detail[]", @delivery do |detail|
%>
...
<%= detail.text_field ''start_mileage'' %>
...
<% end %>
<% fields_for "activity_detail[]", @pickup do |detail| %>
...
<%= detail.text_field ''end_mileage'' %>
...
<% end %>
It works like a charm. However, I''d now like to use Stuart
Rackham''s
date kit helper to format and select some dates for each activity
detail.
e.g. <%= date_field(''person'', ''birthday'',
:value => @person.birthday)
%>
My question is this: What arguments do I pass for this style (non-
member) of form helper in the context of an array of models in a
fields_for, as above?
Page 490 of AWDWR 2nd ed. gives a clue that it should be possible.
Their (very simple case) example goes like this:
<% form_for :user do |form| %>
Name: <%= text_field :user, :name %>
Any thoughts?
Thanks,
Brian
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---