Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for render renderable #58

Open
Spone opened this issue Feb 11, 2025 · 3 comments
Open

Support for render renderable #58

Spone opened this issue Feb 11, 2025 · 3 comments

Comments

@Spone
Copy link

Spone commented Feb 11, 2025

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.

@westonganger
Copy link
Collaborator

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

@Spone
Copy link
Author

Spone commented Feb 11, 2025

Definitely! I think it makes more sense to include this to this gem rather than prawn. Would you accept a PR for this?

@westonganger
Copy link
Collaborator

Yes would love a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants