Sha256: 4a32314b1dc62c47a1d2fe2b6bf862925a639171ed2610c85ed1e68b9141cfcd

Contents?: true

Size: 601 Bytes

Versions: 6

Compression:

Stored size: 601 Bytes

Contents

module ViewModels
  # View model specific view.
  #
  class View < ActionView::Base
    
    # Include the helpers from the view model.
    #
    def initialize controller, master_helper_module
      metaclass.send :include, master_helper_module
      super controller.class.view_paths, {}, controller
    end
    
    #
    #
    def render_with options
      render options.to_render_options
    end

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
view_models-1.5.7 lib/view_models/view.rb
view_models-1.5.6 lib/view_models/view.rb
view_models-1.5.5 lib/view_models/view.rb
view_models-1.5.4 lib/view_models/view.rb
view_models-1.5.3 lib/view_models/view.rb
view_models-1.5.2 lib/view_models/view.rb