Module: Wisepdf::Render
- Defined in:
- lib/wisepdf/render.rb
Class Method Summary collapse
Instance Method Summary collapse
- #render(options = nil, *args, &block) ⇒ Object
- #render_to_string(options = nil, *args, &block) ⇒ Object
Class Method Details
.included(base) ⇒ Object
5 6 7 8 9 |
# File 'lib/wisepdf/render.rb', line 5 def self.included(base) base.class_eval do after_filter :clean_temp_files end end |
Instance Method Details
#render(options = nil, *args, &block) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/wisepdf/render.rb', line 11 def render( = nil, *args, &block) if .is_a?(Hash) && .has_key?(:pdf) = self..merge() super(.merge(:content_type => "text/html"), *args, &block) and return if [:show_as_html] self.log_pdf_creation self.make_and_send_pdf() else super end end |
#render_to_string(options = nil, *args, &block) ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/wisepdf/render.rb', line 23 def render_to_string( = nil, *args, &block) if .is_a?(Hash) && .has_key?(:pdf) self.log_pdf_creation self.make_pdf(self..merge()) else super end end |