-1

Iam Just a beginner In Ruby And When I Try To Assign A variable a command this happens

This is The command I Tried Using IN rails Console

lunch = Todo.new(name: "lunch", description: "iam going to cook lunch")

basically trying to assign a table , column some content

i get this error

ActiveModel::UnknownAttributeError: unknown attribute 'name' for Todo

THANKS IN ADVANCE

Schema File =

ActiveRecord::Schema.define(version: 20180818065237) do

create_table "todos", force: :cascade do |t|
t.string "name"
t.text   "description"
end

end
Cœur
  • 37,241
  • 25
  • 195
  • 267

1 Answers1

0

Run rake db:migrate. Your database is probably not current if an attribute isn't found.

danielricecodes
  • 3,446
  • 21
  • 23