Women in Technology

Hear us Roar



Article:
  Rolling with Ruby on Rails, Part 2
Subject:   Update Error - HELP!
Date:   2007-02-09 14:47:59
From:   theRobin
Response to: Update Error - HELP!

Seems I fouund my problem, right after posting this long post. I tried to add validation into the active records -


class Recipe < ActiveRecord::Base

belongs_to:category
validates_associated :category

end


class Category < ActiveRecord::Base
has_many:recipes
#validates_length_of :category, within => 1..50
validates_uniqueness_of :category, :message => "That category already exists"
end


Anyone know what I did wrong here?