Ruby on rails RubyonRails名称错误

Ruby on rails RubyonRails名称错误,ruby-on-rails,ruby,Ruby On Rails,Ruby,我正在为下面的用户制作一个新的应用程序,我遇到了一些麻烦。这是我的错误: NameError in Welcome#sucess Showing ../welcome/sucess.html.erb where line #13 raised: uninitialized constant User::FollowingRelation Extracted source (around line #13): 10: <br /> 11: Following 12: <ul&g

我正在为下面的用户制作一个新的应用程序,我遇到了一些麻烦。这是我的错误:

NameError in Welcome#sucess
Showing ../welcome/sucess.html.erb where line #13 raised:
uninitialized constant User::FollowingRelation
Extracted source (around line #13):

10: <br />
11: Following
12: <ul>
13:   <% @user.following.each do |u| %>
14:     <li><%= link_to u.username, u %></li>
15:   <% end %>
16: </ul>

我是Ruby on Rails的新手,请帮助我:)

您需要修改这一行:

has_many :following_relations, :foreign_key => :follower_id
致:

我有新的错误:))但我想我可以解决这个问题。谢谢您!!
class Relation < ActiveRecord::Base
  belongs_to :follower, :class_name => "User"
  belongs_to :following, :class_name => "User"
end
def sucess
   @user = User.find(params[:id])
   @relation = Relation.new
 end
has_many :following_relations, :foreign_key => :follower_id
has_many :following_relations, class_name: 'Relation', :foreign_key => :follower_id