Ruby on Rails Tuesday, November 30, 2010

On Nov 28, 10:08 pm, skt <stibre...@gmail.com> wrote:

> In my create function in GradeSection controller I get data posted as
> such
>
> Processing GradeSectionController#create (for 127.0.0.1 at 2010-11-27
> 22:13:46) [POST]
>   Parameters:
> {"authenticity_token"=>"fwdgGanIsScNQUcm6sYc952xhT2BSVH6LXggOJdxhKo=",
> "class_calendar"=>{"dt"=>"Mon Dec 13 2010 22:13:35 GMT-0800 (Paci
> fic Standard Time)", "summary"=>"", "grade_section_id"=>"1",
> "chkproj"=>"0", "uploaded_attachments"=>{"name"=>"Test 2"},
> "chkhw"=>"1"}}
>
> "name" is a string field for filename in UploadedAttachments model (I
> am going to use that model for storing uploaded attachments but taking
> incremental steps - getting just the name for now) and
> grade_section_id is passed in so I create the model through
> ClassCalendar

This data doesn't look like what the nested_attributes stuff looks
like - I would expected it to be more like
'uploaded_attachments_attributes' => {{'0' => {'name' => 'Test 2'}}

What does your form look like?

Fred

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment