Insert multiple entires

need some help with this…

form: <%= simple_form_for(@week) do |f| %>

<% @kws.each do |w,y| %> <%= w %>.<%= “#{y}”[2…4] %> #gives a val something like: 482012 <%= text_field_tag “workhour” %> <%= hidden_field_tag “week_ids”, “[#{w}#{y}]” %> <% end %> <%= hidden_field_tag(:project_id, “#{@project_data.id}”) %>

Controller: def create params[:week_ids].each do |week_id| Week.create( :project_id => params[:project_id], :workhour => params[:workhour], :week_year => week_id )

Log: “workhour”=>[“66”, “”,… “week_ids”=>[“[432012]”, “[442012]”,… “project_id”=>“2”

project_id is in… but how to fetch workhour and week_id?

Thanks for some idea’s

I don't understand the question. You have shown us the code to fetch workhour and week_id from params. What is it that you do not know how to do.

Colin

Hi Colin… thanks…

this is solved so far…