The below code works without error:
  = form_for @blog.comments.build, :remote => true do |f|
However the below results in the error "uninitialized constant User::relationship":
  = form_for @blog.user.followers.build do |f|
User model is declared as below:
class User < ActiveRecord::Base
  has_many :blogs
  has_many :comments
  has_many :relationships, :foreign_key => "follower_id", :dependent => :destroy
  has_many :reverse_relationships, :foreign_key => "followed_id",
                                   :class_name  => "relationship",
                                   :dependent   => :destroy
  has_many :following, :through => :relationships, :source => :followed
  has_many :followers, :through => :reverse_relationships, :source => :follower
end
Why does the first example work but not hte second?
EDIT: Blog model:
class Blog < ActiveRecord::Base
  belongs_to :user
  has_many :comments
end
Relationship model:
class Relationship < ActiveRecord::Base
  attr_accessible :followed_id
  belongs_to :follower, :class_name => "User"
  belongs_to :followed, :class_name => "User"
  validates :follower_id, :presence => true
  validates :followed_id, :presence => true
  validate :validate_followers
  def validate_followers
    errors.add(:follower_id, "You cannot follow yourself") if follower_id == followed_id
  end
end
				
                        
If you change the
:class_nameoption on reverse relationships to:do you still get the problem? It should be the correct case for a class name I believe.