HABTM Relationship — How Can I Find A Record Based On An Attribute Of The Associated Model
You need to include the interests table. @events = Event.all(:include => :interests, :conditions => [“interests.id = ?”, 4]) You had it right in your post, but you didn’t pluralize interests. Update Because this answer is still getting attention, I thought it might be a good idea to update it using ActiveRecord::Relation syntax since the above … Read more