我的 Rails 应用程序包含两个名为 customer 和 order 的模型
class Customer < ActiveRecord::Base
attr_accessible :name
end
class Order < ActiveRecord::Base
belongs_to :customer
# attr_accessible :title, :body
end
在控制台中,我为客户模型创建了实例:
c=Customer.new(:name=>"Noa")
现在我想创建实例来订购引用“c”的模型我该怎么做?谢谢!