prawn-rails
prawn-rails copied to clipboard
Support for render renderable
Rails now supports rendering objects with:
class InvoiceDocument < Prawn::Document
def initialize
# prawn code to render the document
end
end
class InvoicesController
def show
render renderable: InvoiceDocument.new
end
end
Could prawn-rails implement support for this? Prawn::Document would need to respond to #render_in and #format.
We don't define Prawn::Document in this gem, that class is defined by the prawn gem
We could however add these methods to PrawnRails::Document
Definitely! I think it makes more sense to include this to this gem rather than prawn. Would you accept a PR for this?
Yes would love a PR.