I have searched for days for an example that demonstrates what i would
like to do, and this morning i thought i’d worked it out, but
no…here’s what i have:
Controller
class ProfilesController < ApplicationController
def friends
current_user.profile.friends
end
def list_friends
@profile_pages, @profiles = paginate( friends, :per_page => 10)
end
end
Models
class Profile < ActiveRecord::Base
has_many :friendships
has_many :friends,
:through => :friendships
end
class Friendship < ActiveRecord::Base
belongs_to :profile
belongs_to :friend, :class_name => “Profile”, :foreign_key =>
“friend_id”
end
When accessing “http://localhost:3000/profiles/list_friends” i get the
error:
“#Profile:0x10ee01b4#Profile:0x10ee018c” is not a valid constant
name!
Any help gratefully recieved!!
keith