My app has a timesheet, which is a collection of many TimeCards, based
on a Date.
I have one user that can create new TimeCards just fine, except on
three associated Jobs. Each time he saves he gets a 500 error.

Looking at the params, they come across jumbled and my processing
method chokes:
(The first "time_cards" entry is correct, the second is split by the
third)

Parameters:
  {
    "date"=>"2008-12-17",
    "time_cards"=>[
      {
        "job_id"=>"3107",
        "time_card_entry_type"=>"Field",
        "time_card_date"=>"2008-12-17",
        "id"=>"285875",
        "note"=>"Akron e-rate cable project counts/ FSR
presentation",
        "hours"=>"2",
        "user_id"=>"178"
      },
      {
        "time_card_date"=>"2008-12-17",
        "id"=>"285774",
        "user_id"=>"178"
      },
      {
        "job_id"=>"3089",
        "time_card_entry_type"=>"Field",
        "time_card_date"=>"2008-12-17",
        "id"=>"",
        "note"=>"progress drawing and spec revision",
        "hours"=>"2.5",
        "user_id"=>"178"
      },
      {
        "job_id"=>"3107",
        "time_card_entry_type"=>"Field",
        "note"=>"Akron e-rate cable project counts",
        "hours"=>"2"
      }
    ]
  }


The form is a partial that uses index => nil, and it works for all
other users, except this guy, on these associated Jobs.

%tr.entry
  - fields_for "time_cards[]", entry, :index => nil do |entry_form|
    = entry_form.hidden_field(:time_card_date, :value => @date)
    = entry_form.hidden_field(:user_id, :value => session
[:timesheet_user].id)
    = entry_form.hidden_field(:id)

    %td= entry_form.select :job_id, available_jobs
    %td= entry_form.select :time_card_entry_type, allowable_types
    %td= entry_form.text_field :hours, :size => 5
    %td= entry_form.text_field :note


I've scratched my head on this one for weeks, anything look out of
order?
--~--~---------~--~----~------------~-------~--~----~
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 this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to