The error is that the route does not exist. Since a route exists, this problem usually means that Rails routes have not been loaded into the current scope.
You may need to enable Rails route helpers to work properly: Rails.application.routes.url_helpers
Clockwork.every(1.day, 'DailyJob', :at => '01:00'){ StatsMailer.stats_email.deliver Forecast.where(:run_date => Date.today).each do |forecast| # Prepend your route with the following: Rails.application.routes.url_helpers.woschedules_run_jobplans_path(:id => forecast.woschedule_id) end }
Alternatively, to dry it a bit, you can simply include all route helpers at the beginning of the file using:
# Beginning of file include Rails.application.routes.url_helpers # ...
Wes foster
source share