Sha256: 055afcc3c6d8c8dc558dfed110f0467c293ef1ae1ce0759215b4e7e857fcc337

Contents?: true

Size: 522 Bytes

Versions: 3

Compression:

Stored size: 522 Bytes

Contents

module ViewModels
  module Helpers
    
    # Module for conveniently including common view_helpers into a view_model
    #
    module View
      
      # Include hook for the view
      #
      def self.included view_model
        view_model.send :include, *all_view_helpers
      end
      
      # The common view helpers
      # @return [Array] an array of common view helpers
      #
      def self.all_view_helpers
        [
          ActionView::Helpers,
          ERB::Util
        ]
      end
  
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
view_models-4.0.1 lib/view_models/helpers/view.rb
view_models-3.0.1 lib/view_models/helpers/view.rb
view_models-3.0.0 lib/view_models/helpers/view.rb