search for: categories_postings

Displaying 3 results from an estimated 3 matches for "categories_postings".

Did you mean: categories_listings
2006 Jul 12
1
odd habtm behavior? or is it me?
Hello List, I''m a bit spent on this problem, and my code might be whack. I seem to be encountering a problem where the primary key on a join table is not being resolved correctly. I will elaborate after some code bits. I am creating the join table using migrations, and relevant model code is this: class Post < ActiveRecord::Base has_and_belongs_to_many :records
2006 Apr 06
3
has_and_belongs_to_many find
Say I have a post model that has_and_belongs_to_many :categories, and a category model that has_and_belongs_to_many :posts. So I have a categories_posts table to do the join. That''s all find and dandy. However I want to be able to find all the posts that belong to a specific category. I tried Post.find_by_category(:id) but that doesn''t work. Does anyone have any insight?
2006 Feb 14
1
Another HABTM Question
...:action => ''index'' else render :action => ''new'' end end I can successfully load all the categories into a multiple selection box on the page that is creating the posting, but I''m unsure how to save the posting.id and the category.id into the categories_postings table within the ''create'' action. Thank you, Dave Hoefler There really needs to be a ''Rails on Relationships'' book for us geeks ;-)