Hi,

I have a model called Indispo with a attribute :dateIndispo (is type date)
In my controller i have a custom action periode.
One field for date begin and another field date end.
It possible to create all record between the two date with batch_create ?

    


  def periode_create

   

    params[:record][:date_begin]=params[:record][:dateIndispo] if params[
:record][:date_end]==""

    date_debut=Date.strptime(params[:record][:dateIndispo],'%d/%m/%Y')

    date_fin=Date.strptime(params[:record][:date_end],'%d/%m/%Y')

    params[:record]=[]

    i=0

    date_debut.upto(date_fin) do |date|

      params[:record][I][:dateIndispo]=date.to_s

      i=i+1

    end

  how to each params[:record] do_create ?

end

-- 
You received this message because you are subscribed to the Google Groups 
"ActiveScaffold : Ruby on Rails Gem" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/activescaffold.
For more options, visit https://groups.google.com/d/optout.

Reply via email to