# Syntax for the two flavors of field helpers

**URL:** <https://www.ruby-forum.com/t/syntax-for-the-two-flavors-of-field-helpers/106961>\
**Category:** Rails\
**Created:** [June 15, 2007, 8:17pm UTC](https://www.ruby-forum.com/t/syntax-for-the-two-flavors-of-field-helpers/106961 "2007-06-15T20:17:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![brian](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/97f17d/32.png) [@brian](https://www.ruby-forum.com/u/brian)\
**Post date:** [June 15, 2007, 8:17pm UTC](https://www.ruby-forum.com/t/syntax-for-the-two-flavors-of-field-helpers/106961/1 "2007-06-15T20:17:49Z")

</div>

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 R.'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
