我是新来的红宝石。所以,我对下面的代码行困惑:红宝石语法问题
class CreateProducts < ActiveRecord::Migration
def self.up
create_table :products do |t|
t.string :title
t.text :description
t.string :image_url
t.decimal :price, :precision => 8, :scale => 2
t.timestamps
end
end
def self.down
drop_table :products
end
end
行的人让我最困惑的是:
t.string :title
我只是不明白。那么,为了理解这一行代码,你们中的任何一个人可以给我一些提示,指出我需要阅读哪些ruby语法部分?提前致谢。
()方法调用与对象方向有什么关系? – 2010-11-24 14:38:17