I'm creating a social network in Rails. I have a User model and a Page model. Users can "follow" or subscribe to Pages. So a user can have many pages and a page can have many users. How wou开发者_高级运维ld these relationships be stored in the database? Do I need to create a new object Subscription which belongs_to :user?
Generally this is done with a "join model", which would be UserPage, and a user_pages table. You could call it Subscription if you wanted, but Rails will reward you for sticking to its expected semantics.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论