You miss t.references :story
in your migration. The belongs_to method on category requires story_id
.
class CreateCategories < ActiveRecord::Migration
def change
create_table :categories do |t|
t.references :story
t.string :body
t.timestamps
end
end
end