Module: ViewModels::Extensions::View

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

Overview

Extensions for the View instance

Instance Method Summary (collapse)

Instance Method Details

- (Object) find_template(path)

Finds the template in the view paths at the given path, with its format.

Parameters:

  • path (String)

    the template path



23
24
25
# File 'lib/view_models/extensions/view.rb', line 23

def find_template path
  view_paths.find_template path, template_format rescue nil
end

- (Object) render_with(options)

Renders the template with the given options

Parameters:



16
17
18
# File 'lib/view_models/extensions/view.rb', line 16

def render_with options
  render options.to_render_options
end