Reputation: 171
I am a novice of Rails. And I wanna create a tiny SNS like Twitter.
How to implement the follower system with AciveRecord in has_and_belongs_to_many?
I create a "User" table. And the follower relationship is a many-to-many logic between one user and one user.
So how to decelerate the model class and create the join table?
Upvotes: 0
Views: 825
Reputation: 2528
The last chapter of railstutorial is talking about what you want. http://ruby.railstutorial.org/chapters/following-users#top
Upvotes: 1