Skip to content

Commit

Permalink
Merge pull request #39 from fivegoodfriends/rails-6-template-handler
Browse files Browse the repository at this point in the history
Fix deprecation warnings on Rails 6
  • Loading branch information
westonganger committed May 22, 2019
2 parents 5964573 + 9be2087 commit 7991f33
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/prawn-rails/renderer.rb
Expand Up @@ -4,15 +4,15 @@ module PrawnRails
class Renderer

### WARNING: BE VERY CAREFUL IF EDITING THIS METHOD
def self.call(template)
def self.call(template, source = nil)
%{
@filename ||= "\#{controller.action_name}.pdf"
if controller.respond_to?(:response) && !controller.response.nil?
controller.response.headers['Content-Disposition'] = "inline; filename=\\\"\#{@filename}\\\""
end
#{template.source.strip}
#{(source || template.source).strip}
}
end

Expand Down

0 comments on commit 7991f33

Please sign in to comment.