-
Notifications
You must be signed in to change notification settings - Fork 39
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
DEPRECATION WARNING: Rendering actions with '.' in the name is deprecated #43
Comments
Can you show me the call to the render action from your controller code? |
Hi @westonganger, thanks for the quick reply. It looks like this: Admin::ContractsController.render(
template: "admin/contracts/show.pdf.prawn",
assigns: {
decorated_pdf_contract: DecoratedPdfContract.new(@contract)
}
) |
So you are trying to render to a string? We discussed this in #32 Maybe try one of the following (untested): render_to_string(
"admin/contracts/show",
formats: [:pdf],
assigns: {
decorated_pdf_contract: DecoratedPdfContract.new(@contract)
}
)
### OR
Admin::ContractsController.render(
template: "admin/contracts/show",
formats: [:pdf],
assigns: {
decorated_pdf_contract: DecoratedPdfContract.new(@contract)
}
) |
Oh man. This is embarrassing. I tried template: "admin/contracts/show",
formats: [:pdf], Works perfectly. Thanks again for the quick responses @westonganger! |
:D |
Hello there and thanks for prawn-rails!
We're seeing a deprecation warning since a recent rails upgrade:
We're rendering a file the way suggested in
https://github.com/cortiz/prawn-rails/issues/32
, but I assume this is an issue with all templates that follow the file naming convention from your docs.Is this something you're aware of? Are you working on a fix or do you have a suggestion on how to fix the issue on our side?
Thanks in advance and all the best!
The text was updated successfully, but these errors were encountered: