Nikita Misharin

Writing stuff on the internet to appear smarter, than
I actually am

Generating pdf with wickedpdf in sidekiq

Recently, I had to generate invoice pdf in a background job. There is a documentation for how to do so, but it seemes overly complicated.

Here is a shorter, more readable version and without unnecessary class_eval

view ='app/views/resources/', {},

html = view.render(file: 'show.html.slim', locals: { resource: resource })

Returned pdf you can then upload to S3 or **store in a file.

Read Next:

What protected actually does?