0
注文確認で、売り手とユーザーの両方が確認を受け取りますが、追加した後に、seller_idまたはbuyer_idのレールがエラーを吐き出します!Railsどのようにメーラーにforeign_keyを取得しますか?
私は解決策として、どこsuerに探していますが、
誰かがメーラーにFOREIGN_KEYを渡す方法のアイデアを持っている固有のIDを見つけられませんでしたか?
感謝の
class Order < ActiveRecord::Base
belongs_to :seller, foreign_key: 'seller_id', class_name: 'Shop'
belongs_to :buyer, foreign_key: 'buyer_id', class_name: 'User'
end
def order_confirmation(order)
@order = order
@buyer = Order.where('buyer_id')
mail(to: @buyer.email, subject: 'confirmation', &:html)
end
def order_confirmation_seller(order)
@order = order
@seller = Order.where('seller_id')
mail(to: @seller.email, subject: 'confirmation', &:html)
end