Henry Pak wrote:> Does anyone know why I am unable to do the following:
>
> <%
> select ''interview'', ''date(2i)'',
list_months
> text_field ''interview'', ''date(3i)'',
''size'' => 2, ''maxsize'' => 2
> text_field ''interview'', ''date(1i)'',
''size'' => 4, ''maxsize'' => 4
> %>
>
> but when I use
> <%
> date_select ''interview'', ''date''
> %>
>
> I get no problems even though the html generated has the same names
> for the controls. The error says that there is no method date(2i)
> etc. I tried looking at the date_helper.rb file, but I must be
> missing something. Can anyone provide me with some insight? I''m
> guessing AR somehow is creating new date objects or something but I
> can''t figure it out. Thanks in advance.
date_select knows how to insert the right initial values, while
the form helpers can''t. I suggest you instead use the select_tag
and text_field_tag helpers, generating your own value parameters.
--
We develop, watch us RoR, in numbers too big to ignore.