我已经为订单确认生成了一个邮件。我在 /purchases 处收到 NameError。错误内容如下:
uninitialized constant PurchasesController::UserMailer
/controllers/purchases_controller.rb
class PurchasesController < InheritedResources::Base
before_filter :authenticate_admin_user!, :only => [:index, :edit, :update, :destroy]
def create
@purchase = Purchase.new(params[:purchase])
if @purchase.save
UserMailer.purchase_confirmation(@purchase).deliver
redirect_to "/thankyou"
else
render :action => "new"
end
我一直在挖掘并发现了类似的问题,但还没有解决我的问题。有什么帮助吗?