Sha256: fd4f38b7240ec76e25d624f3669d4e5550631a4674f4d5030fa148578db3f572
Contents?: true
Size: 978 Bytes
Versions: 14
Compression:
Stored size: 978 Bytes
Contents
module Draper # Provides the {#helpers} method used in {Decorator} and {CollectionDecorator} # to call the Rails helpers. module ViewHelpers extend ActiveSupport::Concern module ClassMethods # Access the helpers proxy to call built-in and user-defined # Rails helpers from a class context. # # @return [HelperProxy] the helpers proxy def helpers Draper::ViewContext.current end alias_method :h, :helpers end # Access the helpers proxy to call built-in and user-defined # Rails helpers. Aliased to `h` for convenience. # # @return [HelperProxy] the helpers proxy def helpers Draper::ViewContext.current end alias_method :h, :helpers # Alias for `helpers.localize`, since localize is something that's used # quite often. Further aliased to `l` for convenience. def localize(*args) helpers.localize(*args) end alias_method :l, :localize end end
Version data entries
14 entries across 14 versions & 4 rubygems