Skip to content

Commit

Permalink
Fix deprecation warnings on Rails 6.
Browse files Browse the repository at this point in the history
This maintains backwards compatibility with earlier versions of Rails.
  • Loading branch information
tatey committed May 22, 2019
1 parent 5964573 commit 9be2087
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/prawn-rails/renderer.rb
Original file line number Diff line number Diff line change
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 9be2087

Please sign in to comment.