'Resque background process: uninitialized constant SampleController::Resque Error

I am getting the following while executing the job asynchronously by using Resque scheduler.

uninitialized constant SampleController::Resque

I have the folloiwng code in sample_controller.rb:

Resque.enqueue(RailsWorker,{:model=>object.class.to_s,:object_id=>object.id,:meth=>:sync_object})

I have already started Resque by using resque:work rake task.

Can anyone help me to fix this error?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source