我创建了 ruby 类并将其放在 app_dir/lib/appointment_messaging_job.rb
class AppointmentMessagingJob
def perform
end
end
在我的一个控制器中,我这样做:
test = AppointmentMessagingJob.new
我得到一个非常烦人非常难以理解的错误:
Started GET "/en/appointments/1/approve" for 127.0.0.1 at 2012-09-04 13:02:43 -0400
Processing by AppointmentsController#approve as HTML
Parameters: {"locale"=>"en", "id"=>"1"}
Completed 500 Internal Server Error in 2ms
NameError (uninitialized constant AppointmentsController::AppointmentMessagingJob):
app/controllers/appointments_controller.rb:89:in 'approve'
这个未初始化的常数是什么?我真的不明白。