「unknown attribute :news_id」というエラー メッセージが表示されますが、どこに問題があるのかわかりません。ニュースコントローラーがあり、すべてのニュースにコメントを作成したいと考えています。誰かが私を助けてくれることを願っています。前もって感謝します。
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
コメントモデル:
belongs_to :news
ニュースモデル:
has_many :comments