看板 Ruby 關於我們 聯絡資訊
在 migration 中, 使用 create_table 時 通常會寫成 create_table :table_name do |t| end create_table 的 signature 為 create_table(table_name, options = {}) 有 table_name 及 options 兩個 parameters 為什麼不是寫成 create_table :table_name, do |t| end 這樣子呢? (兩個parameters 所以用 , 隔開) 還是說以 block 為 parameter 時,可以不用使用 , 希望各位大大解惑 謝謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 118.169.7.94 ※ 文章網址: https://www.ptt.cc/bbs/Ruby/M.1425438762.A.BA3.html
GinginDenSha: 剛剛找到答案: http://ppt.cc/aL9m 03/04 11:35