Models 2 what'swrong?how to add column?


#1

class CreateTags < ActiveRecord::Migration
def change
create_table :tags do |t|
t.string: title
t.string: image
t.timestamps
end
end
end


#2

Should have the names as symbols:

t.string :title

#3

can i ask why having the space works t.string: title but having t.string:title doesn't and throws an error: Make sure the Destination migration file has columns for name, image, and description, all of type string.


#4

If you don't have a space it is recognized as one keyword.


#5

i see, thanks!! :slight_smile: