Module: PdfHelper

Defined in:
lib/princely/pdf_helper.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



4
5
6
7
8
# File 'lib/princely/pdf_helper.rb', line 4

def self.included(base)
  base.class_eval do
    alias_method_chain :render, :princely
  end
end

Instance Method Details

#render_with_princely(options = nil, *args, &block) ⇒ Object



10
11
12
13
14
15
16
17
# File 'lib/princely/pdf_helper.rb', line 10

def render_with_princely(options = nil, *args, &block)
  if options.is_a?(Hash) && options.has_key?(:pdf)
    options[:name] ||= options.delete(:pdf)
    make_and_send_pdf(options.delete(:name), options)      
  else
    render_without_princely(options, *args, &block)
  end
end