I am trying to test the MovieApp on my computer and I am getting this error:
SQLite3::SQLException: no such column: parts.movie_id: SELECT "actors".* FROM "actors" INNER JOIN "parts" ON "actors"."id" = "parts"."actor_id" WHERE "parts"."movie_id" = ?
Extracted source (around line #15):
<h2>Cast</h2> <% @actors.each do |actor| %> <div class="actor"> <%= actor.image %> <h3 class="actor-name"> <%= actor.first_name %> <%= actor.last_name %></h3>
The creation in schema.db file is actually wrong:
create_table "parts", force: :cascade do |t|
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
although in both models/part.rb
class Part < ActiveRecord::Base
and in db/migrate
class CreateParts < ActiveRecord::Migration
create_table :parts do |t|
t.belongs_to :movie, index: true
t.belongs_to :actor, index: true
I did everything as in the example.
Can anyone help me to understand if there is any other file I need to check? Any idea on what it's going wrong?