Module: PdfHelper
- Defined in:
- lib/wicked_pdf/pdf_helper.rb
Class Method Summary collapse
Instance Method Summary collapse
- #render_to_string_with_wicked_pdf(options = nil, *args, &block) ⇒ Object
- #render_with_wicked_pdf(options = nil, *args, &block) ⇒ Object
Class Method Details
.included(base) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/wicked_pdf/pdf_helper.rb', line 4 def self.included(base) # Protect from trying to augment modules that appear # as the result of adding other gems. return if base != ActionController::Base base.class_eval do alias_method_chain :render, :wicked_pdf alias_method_chain :render_to_string, :wicked_pdf after_filter :clean_temp_files end end |
Instance Method Details
#render_to_string_with_wicked_pdf(options = nil, *args, &block) ⇒ Object
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/wicked_pdf/pdf_helper.rb', line 26 def render_to_string_with_wicked_pdf( = nil, *args, &block) if .is_a?(Hash) && .key?(:pdf) log_pdf_creation [:basic_auth] = set_basic_auth() .delete :pdf make_pdf((WickedPdf.config || {}).merge()) else render_to_string_without_wicked_pdf(, *args, &block) end end |
#render_with_wicked_pdf(options = nil, *args, &block) ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/wicked_pdf/pdf_helper.rb', line 16 def render_with_wicked_pdf( = nil, *args, &block) if .is_a?(Hash) && .key?(:pdf) log_pdf_creation [:basic_auth] = set_basic_auth() make_and_send_pdf(.delete(:pdf), (WickedPdf.config || {}).merge()) else render_without_wicked_pdf(, *args, &block) end end |