On Apr 8, 3:11 am, "Lucas J." <[email protected]> wrote:
> Thanks, Jeffrey.  I just wanted to ensure that I was on the right track
> and that I wasn't setting myself up for more problems later.
>
> Tom - I tried google first (I always do).  My attributes are already set
> to attr_accessible in my models (there are only three at this point),
> which is why I was so confused.  I'm sure there's something I'm
> overlooking but I'm not going to spend too much more time on it since I
> have a working solution at this point.
>
If you want to be able to do line_items.build(product: p) you need to
mark product as attr_accessible too. The mass assignment stuff doesn't
know what things are database attributes, virtual attributes,
associations etc.

Fred


> --
> Posted viahttp://www.ruby-forum.com/.

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to