Forum: Ruby on Rails Rails console Association error

C5a9fb8b6d691679e357d420d8b65e75?d=identicon&s=25 Paul Kioko (slickpk)
on 2014-01-27 23:16
I have tried to use the rails console to run the following:

It tells me:
Association named 'live_player' was not found on Teamplayer; perhaps you
misspelled it?

so the tables are named live_players and teamplayers respectively. There
is also another table called teams but that will only make sense in the
models below:


class LivePlayer < ActiveRecord::Base
has_many :teamplayers
has_many :fteams, :through => :teamplayers


class Fteam < ActiveRecord::Base
belongs_to :liveplayer

class Teamplayer < ActiveRecord::Base
belongs_to :live_player
belongs_to :fteam

so what is problem with this. I have been at this for days
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.