KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I'm getting the error unknown attribute: user_id durring execution of current_user.stories.build class User < ActiveRecord::Base has_many :stories, class_name: 'Story', foreign_key: 'user_id', dependent: :destroy ... class Story < ActiveRecord::Base belongs_to :user, class_name: 'User', foreign_key: 'user_id' ... schema.rb create_table "stories", :force => true do |t| t.string "responsible" t.string "descr" t.string "state" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false end create_table "users", :force => true do |t| t.string "email" t.string "password_digest" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false t.string "name" end It doesn't contain 'user_id' field. Any ideas?
Tags (comma-separated)
Save Edits
Cancel