class Customers < ActiveRecord::Base
def check_user_name
...
mailto = Emailer.new
mailto.contact(email, subject='ask', question)
end
end
class Emailer < ActionMailer::Base
def contact(email, subject, question, sent_at = Time.now)
...
end
end
控制器:
class CustomersController < ApplicationController
def ask
end
def check_user
cust = Customers.new
@answer = cust.check_user_name(params[:name], params[:email], params[:question])
end
end
有这个错误:
客户控制器中的 NoMethodError#check_user