KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
What I am trying to do: I have a blog and want to show related posts below the main post. class Post < ActiveRecord::Base has_many :related_posts has_many :posts, :through => :related_posts end And then in the join model/table class RelatedPost < ActiveRecord::Base belongs_to :post end And of course there is a table called related_posts with two post_id columns. Obviously there are several flaws with this, I'm just not sure how to make this association work in Rails.
Tags (comma-separated)
Save Edits
Cancel