Re: problem date_select with active_form

Sandy
Fri, 18 Sep 2009 03:52:49 -0000

First, you do not need a plug-in to get a date in a form.  The fact
that you''re using one, though, is irrelevant to the issue.

Next, look at the params hash which you''re getting.  It clearly has
the date as September 17, 2009, which is in the "period" hash as:

 "period(3i)"=>"17",
 "period(1i)"=>"2009",
 "period(2i)"=>"9"

You have to understand that the "period" hash has three parts,
identified as period(1i), period(2i), and period(3i), representing the
year, month, and day, respectively.

Accordingly, if your controller included something like:

@p = params[:period]

you would then be able to identify the respective portions of the
date.

So, what''s the problem?

Sandy


On Sep 17, 12:01 pm, Colin Law
<clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
wrote:
> 2009/9/17 Aldo Italo
<rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>:
>
>
>
> >> What type is the column period in the database?
>
> > this is a form wich submit an email,
>
> > there arent''t database for this model, i have used
active_form plugin to
> > obtain this.
>
> I''m out of my comfort zone in that case, I guess it is expecting
> FormContact to have a DateTime field called period.  I don''t know
how
> you would handle that.
>
> Colin