On Thu, May 6, 2010 at 10:20 AM, ct9a <[email protected]> wrote:
> class Fit < ActiveRecord::Base
> belongs_to :Part
> belongs_to :Brand
It probably doesn't make a difference, but conventionally the
attribute ids should be lowercase
belongs_to :part
belongs_to :brand
>
> validates_presence_of :part_id
The association name is :part not :part_id
so
validates_presence_of :part
HTH
--
Rick DeNatale
Blog: http://talklikeaduck.denhaven2.com/
Github: http://github.com/rubyredrick
Twitter: @RickDeNatale
WWR: http://www.workingwithrails.com/person/9021-rick-denatale
LinkedIn: http://www.linkedin.com/in/rickdenatale
--
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.