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