Module: Princely::PdfHelper
- Defined in:
- lib/princely/pdf_helper.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
permalink .included(base) ⇒ Object
[View source]
6 7 8 9 |
# File 'lib/princely/pdf_helper.rb', line 6 def self.included(base) base.send :alias_method, :render_without_princely, :render base.send :alias_method, :render, :render_with_princely end |
permalink .prepended(base) ⇒ Object
[View source]
11 12 13 14 |
# File 'lib/princely/pdf_helper.rb', line 11 def self.prepended(base) base.send :alias_method, :render_without_princely, :render base.send :alias_method, :render, :render_with_princely end |
Instance Method Details
permalink #render_with_princely(options = nil, *args, &block) ⇒ Object
[View source]
16 17 18 19 20 21 22 23 |
# File 'lib/princely/pdf_helper.rb', line 16 def render_with_princely( = nil, *args, &block) if .is_a?(Hash) && .has_key?(:pdf) [:name] ||= .delete(:pdf) make_and_send_pdf(.delete(:name), ) else render_without_princely(, *args, &block) end end |