Module: Qbrick::AdminHelper

Defined in:
app/helpers/qbrick/admin_helper.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object

When rendering the layout of our host application, the paths of the host application are not visible to the engine therefore we delegate all failing helper calls to ‘main_app’, which is our host application



9
10
11
12
13
14
15
16
17
# File 'app/helpers/qbrick/admin_helper.rb', line 9

def method_missing(method, *args, &block)
  main_app.send(method, *args, &block)
rescue NoMethodError => exception
  bc = ::ActiveSupport::BacktraceCleaner.new
  bc.add_silencer { |l| l =~ /^#{__FILE__}.+#{__method__}'?$/ }
  exception.set_backtrace bc.clean(exception.backtrace)

  raise exception
end

Instance Method Details

#sublime_video_include_tagObject



19
20
21
22
# File 'app/helpers/qbrick/admin_helper.rb', line 19

def sublime_video_include_tag
  token = Qbrick::Engine.config.sublime_video_token
  javascript_include_tag "//cdn.sublimevideo.net/js/#{token}-beta.js"
end