RailsCasts Pro episodes are now free!
Learn more or hide this
GitHub User: otagi
I'm using this to insert an S3 image into a table cell:
class CustomPdf < Prawn::Document require 'open-uri' def image_cell(image_url) {image: open(image_url), fit: [IMAGE_SIZE, IMAGE_SIZE], position: :center} rescue SocketError "" end end
Then just call image_cell in your table data array: [ [ image_cell(url), ... ], [ ... ] ].
image_cell
[ [ image_cell(url), ... ], [ ... ] ]
You are correct, Heroku requires a separate worker dyno to launch background jobs.
You can use the Workless gem, which creates and kills a worker when DelayedJob is called. Heroku will only bill you the uptime ($0.05/h), not the full $35/m.
Great screencast as always.
Confirmation boxes are still useful, though. Undoing changes on a model with a Paperclip attachment is less trivial.
I'm using this to insert an S3 image into a table cell:
Then just call
image_cell
in your table data array:[ [ image_cell(url), ... ], [ ... ] ]
.You are correct, Heroku requires a separate worker dyno to launch background jobs.
You can use the Workless gem, which creates and kills a worker when DelayedJob is called. Heroku will only bill you the uptime ($0.05/h), not the full $35/m.
Great screencast as always.
Confirmation boxes are still useful, though. Undoing changes on a model with a Paperclip attachment is less trivial.