Module: StaticHelper
- Defined in:
- lib/static_helper.rb
Class Method Summary collapse
Instance Method Summary collapse
- #render_to_string_with_go_static(options = nil, *args, &block) ⇒ Object
- #render_with_go_static(options = nil, *args, &block) ⇒ Object
Class Method Details
.included(base) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/static_helper.rb', line 5 def self.included(base) base.class_eval do alias_method_chain :render, :go_static alias_method_chain :render_to_string, :go_static after_filter :clean_temp_files end end |
Instance Method Details
#render_to_string_with_go_static(options = nil, *args, &block) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/static_helper.rb', line 24 def render_to_string_with_go_static( = nil, *args, &block) if .is_a?(Hash) && .has_key?(:png) log_png_creation [:format] ||= "png" [:basic_auth] = set_basic_auth() .delete :png make_png((GoStatic.config || {}).merge()) else render_to_string_without_go_static(, *args, &block) end end |
#render_with_go_static(options = nil, *args, &block) ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/static_helper.rb', line 13 def render_with_go_static( = nil, *args, &block) if .is_a?(Hash) && .has_key?(:png) log_png_creation [:format] ||= "png" [:basic_auth] = set_basic_auth() make_and_send_png(.delete(:png), (GoStatic.config || {}).merge()) else render_without_go_static(, *args, &block) end end |