I’m having trouble with validation. I want to require the user to select
a category before a post is successfully created.
I’m using has_many :through for posts and categories as follows:
class Post < ActiveRecord::Base
has_many :categories, :through => :categorizations
class Categorization < ActiveRecord::Base
class Category < ActiveRecord::Base
has_many :posts, :through => :categorizations
I’ve tried validates_presence_of :categorizations in the Post model, but
the application simply saves it without verifying that the user selected
Any ideas what I can do?