Class: ViewModels::View

Inherits:
ActionView::Base
  • Object
show all
Defined in:
lib/view_models/view.rb

Overview

View model specific view.

Since:

Instance Method Summary (collapse)

Constructor Details

- (View) initialize(controller, master_helper_module)

Include the helpers from the view model.

Since:

  • 1.0.0



13
14
15
16
# File 'lib/view_models/view.rb', line 13

def initialize controller, master_helper_module
  singleton_class.send :include, master_helper_module
  super controller.class.view_paths, {}, controller
end

Instance Method Details

- (Object) find_template(path, second = nil)

Rails 3 calls it with 2 arguments

Since:

  • 1.0.0



26
27
28
# File 'lib/view_models/view.rb', line 26

def find_template path, second=nil
  lookup_context.find_template path rescue nil
end

- (Object) render_with(options)

Since:

  • 1.0.0



20
21
22
# File 'lib/view_models/view.rb', line 20

def render_with options
  render options.to_render_options
end