Module: Automux::Controller::Support::Rendering

Included in:
Base
Defined in:
lib/automux/controller/support/rendering.rb

Instance Method Summary collapse

Instance Method Details

#render(view) ⇒ Object

There are two requirements to render a file.

  1. @binding

  2. file_name



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/automux/controller/support/rendering.rb', line 9

def render(view)
  path =
  # If the full path to the file is given, use that instead.
  if FileTest.exists?(view)
    view
  else
    deduce_full_path(view)
  end

  execute Automux::Library::MiniErb.new(File.read(path)).result(@binding)
end