Module: MobileEnhancements::HelperDelegation

Defined in:
lib/mobile_enhancements/helper_delegation.rb

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



8
9
10
11
12
13
14
15
16
17
# File 'lib/mobile_enhancements/helper_delegation.rb', line 8

def self.included(base)
  base.extend Forwardable
  base.def_delegators :mobile_enhancement_helpers, *RequestHelper.delegated_methods
  # make the methods available as view helpers if available
  if base.respond_to?(:helper_method)
    base.helper_method *RequestHelper.delegated_methods
  end
  # include the UrlHelper
  base.send(:include, UrlHelper)
end