Module: Draper::ViewHelpers

Extended by:
ActiveSupport::Concern
Included in:
CollectionDecorator, Decorator
Defined in:
lib/draper/view_helpers.rb

Overview

Provides the #helpers method used in Decorator and CollectionDecorator to call the Rails helpers.

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#helpersHelperProxy Also known as: h

Access the helpers proxy to call built-in and user-defined Rails helpers. Aliased to h for convenience.

Returns:



24
25
26
# File 'lib/draper/view_helpers.rb', line 24

def helpers
  Draper::ViewContext.current
end

#localize(*args) ⇒ Object Also known as: l

Alias for helpers.localize, since localize is something that's used quite often. Further aliased to l for convenience.



31
32
33
# File 'lib/draper/view_helpers.rb', line 31

def localize(*args)
  helpers.localize(*args)
end