I’m trying to create a simple blog app without scaffolding, and I’m having problems with associations.
I’m relatively new to this, and I would love some help. I’m sorry for bugging you with such a newbie question, but I couldn’t find a tutorial about this.
I made my models like this:
model g User username password
model g Admin
model g Poster
model g Post title content
then, I set the associations like this:
then, when I go to the rails console, I cant make a post that belongs to poster, or a post that belongs to poster…
User.create(:name => “joe”)
usr = User.last
usr.Poster.create() ---- returns an error
What am I doing wrong here?