这是我在这里发表的第一篇文章.我正在尝试在Rails 3.2.1中构建我的第一个应用程序.我正在尝试使用以下终端命令为Paint生成一个脚手架:
rails generate scaffold Paint paint_family:string paint_hex:array paint_available:boolean paint_location:integer paint_quantity:integer paint_additional_info:text
Run Code Online (Sandbox Code Playgroud)
但是当我尝试迁移时,我收到以下错误:
undefined method `array' for #<ActiveRecord::ConnectionAdapters::TableDefinition:0x007fbd8bdb1c58>
Run Code Online (Sandbox Code Playgroud)
这是迁移记录:
class CreatePaints < ActiveRecord::Migration
def change
create_table :paints do |t|
t.string :paint_family
t.array :paint_hex
t.boolean :paint_available
t.integer :paint_location
t.integer :paint_quantity
t.text :paint_additional_info
t.timestamps
end
end
Run Code Online (Sandbox Code Playgroud)
结束
我无法为我的生活找出原因.但那是因为我不知道自己在做什么.任何建议/帮助将不胜感激.