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?
Asked
Active
Viewed 817 times
0

Ghjhdf
- 161
- 8
-
See this previous answer: http://stackoverflow.com/a/4381282/1042144 – Brian Kung Mar 25 '13 at 14:37
1 Answers
1
The last chapter of railstutorial is talking about what you want. http://ruby.railstutorial.org/chapters/following-users#top

hsming
- 2,468
- 3
- 14
- 14