Module: TusurCdn::ActionView::Helpers

Defined in:
lib/tusur_cdn/action_view/helpers.rb

Instance Method Summary collapse

Instance Method Details

#render_cdn(key) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/tusur_cdn/action_view/helpers.rb', line 5

def render_cdn(key)
  data = TusurCdn::Consumer.new(key: key).get_data
  result = ERB.new(data.template).result(binding)
  result.html_safe
rescue => exception
  Airbrake.notify(
    "Отвалился модуль #{key} на #{Rails.application.class.parent_name}",
    {
      redis_data: data,
      exception: exception
    }
  )
  return nil
end