4
我試圖做一個支架,但要到的has_many屬性傳遞到生成命令如下:Rails的:通過的has_many或belongs_to的屬性在「生成」命令
rails generate scaffold grade name:string {has_many :sections}
這產生破壞的模型:
class Grade < ActiveRecord::Base
attr_accessible :, :name, :{has_many
end
,而不是我所需要的:
class Grade < ActiveRecord::Base
attr_accessible :name
has_many :sections
end
我如何傳遞一個關係屬性的屬te命令?
請接受最佳答案 – felipeclopes