Module: PdfHelper
- Defined in:
- lib/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
5 6 7 8 9 10 11 |
# File 'lib/pdf_helper.rb', line 5 def self.included(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
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/pdf_helper.rb', line 23 def render_to_string_with_wicked_pdf( = nil, *args, &block) if .is_a?(Hash) && .has_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
13 14 15 16 17 18 19 20 21 |
# File 'lib/pdf_helper.rb', line 13 def render_with_wicked_pdf( = nil, *args, &block) if .is_a?(Hash) && .has_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 |