OK I've gone for a different approach.
I've created an abstract controller that is being called directly from the worker class, as describe here http://www.whatastruggle.com/generating-pdfs-in-background
Thanks anyway
Edit
Seems the link is dead, so to sum up what worked:
Create a new controller, this will be the rendering controller
rendering_controller.rb
class RenderingController < AbstractController::Base
include AbstractController::Rendering
include ActionView::Layouts
include AbstractController::Helpers
include AbstractController::Translation
include AbstractController::AssetPaths
include Rails.application.routes.url_helpers
include WickedPdf::PdfHelper
self.view_paths = 'app/views'
end
Then wherever you need to use it
rc = RenderingController.new
rc.render_to_string(template: 'template/name', locals: { local: value })
Note this is no longer required if you're using Rails 5+ since they enabled rendering outside of controllers. Instead you can now just do:
ApplicationController.render :index
More details are available here