Hello all. I have the following code in my Accounts controller:
@account = Account.create(params[:account])
@website = @account.websites.create(params[:website])
@contact = @account.contact.create(params[:contact])
My Account model has_one :contact and my Contact belongs_to :account,
yet I get the following error:
NoMethodError: You have a nil object when you didn't expect it!
The error occurred while evaluating nil.create
- - - - - -
I've scoured the documentation and can't find where I'm mucking things
up. Any help is greatly appreciated!