Re: problem date_select with active_form

Colin Law
Thu, 17 Sep 2009 12:30:45 -0000

2009/9/16 Aldo Italo
<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>:
>
> hi,
> i have a problem with date_select and and active_form plugin
>
> example:
>
>
> view:
> form_for( "contact", :url => { :action =>
"form_contact" } ) do |f|
>  .... other code ....
>  f.date_select :period, :order => [:day, :month, :year]
>  .... other code ....
> end
>
>
> model:
> class FormContact < ActiveForm
>  attr_accessor :name, :surname, :period, ......
>  ... validations
> end
>
>
> control:
> def form_contact
>  @contact = FormContact.new(params[:contact])
>  respond_to do |format|
>    if @contact.valid?
>    ..........
>    end
>  end
> end
>
>
>
> when i submit the for wen is present the date_select i retrive an error
> controller like this:
>
> `@period(3i)'' is not allowed as an instance variable name

Where is that error appearing, is it your code or some plugin?  If it
is your code what do you expect @period(3i) to do?

Colin

>
>
> why?
> --
> Posted via http://www.ruby-forum.com/.
>
> >
>