我正在开发一个类似于 Michael Hartl 的Railstutorial的示例应用程序,并希望显示 current_user未关注的所有用户。我怎样才能做到这一点?
用户.rb 是:
has_many :following_relationships, class_name: "Relationship", foreign_key: :follower_id
has_many :leading_relationships, class_name: "Relationship", foreign_key: :leader_id
关系.rb 是:
belongs_to :follower, class_name: "User"
belongs_to :leader, class_name: "User"