我是新來的紅寶石。所以,我對下面的代碼行困惑:紅寶石語法問題
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