我需要获取所选订单的配置文件(打印订单)。
我的profiles表有一user_id列,我的prints表也有一user_id列。
和Profile模型Print模型belongs_to :user。
打印型号:
class Print < ActiveRecord::Base
attr_accessible :comment, :document
belongs_to :user
end
和,轮廓模型:
class Profile < ActiveRecord::Base
attr_accessible :address, :name, :phone
belongs_to :user
has_many :prints
end
如何根据用户从配置文件中获取打印数据?