Sha256: 420fd5feb7907d6f7df7b21facbc450718d300ba974d3b9b8cad82ebb3f2892b

Contents?: true

Size: 704 Bytes

Versions: 3

Compression:

Stored size: 704 Bytes

Contents

# Not used at the moment
#
# Extends a standard ActionView::Base view with methods
# needed by the view models.
#
module ViewModels
  module Extensions
    
    # Extensions for the View instance
    #
    module View
      
      # Renders the template with the given options
      # @param [RenderOptions::Base] options The options to render with
      #
      def render_with options
        render options.to_render_options
      end

      # Finds the template in the view paths at the given path, with its format.
      # @param [String] path the template path
      #
      def find_template path
        view_paths.find_template path, template_format rescue nil
      end
      
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

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