On 23 October 2012 09:47, Werner <webagentur.la...@googlemail.com> wrote:
> need some help with this..
>
> form:
>  <%= simple_form_for(@week) do |f| %>
>
> <% @kws.each do |w,y|  %>
>      <th><%= w %>.<%= "#{y}"[2..4] %></th> #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?

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

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to