Module: ViewModels::Helpers::View

Defined in:
lib/view_models/helpers/view.rb

Overview

Module for conveniently including common view_helpers into a view_model

Class Method Summary (collapse)

Class Method Details

+ (Array) all_view_helpers

The common view helpers

Returns:

  • (Array)

    an array of common view helpers



17
18
19
20
21
22
# File 'lib/view_models/helpers/view.rb', line 17

def self.all_view_helpers
  [
    ActionView::Helpers,
    ERB::Util
  ]
end

+ (Object) included(view_model)

Include hook for the view



10
11
12
# File 'lib/view_models/helpers/view.rb', line 10

def self.included view_model
  view_model.send :include, *all_view_helpers
end