I have an error message - "unknown attribute: news_id", but I can not understand where the problem is. I have a news controller and I want to create comments for each news. I hope someone can help me. Thanks in advance.
schema.rb
create_table "comments", :primary_key => "ID", :force => true do |t| t.integer "Author_ID" t.integer "News_ID", :null => false t.string "Content", :limit => 500, :null => false t.datetime "Date", :null => false end
Comment Model:
belongs_to :news
News Model:
has_many :comments
source share