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



6
7
8
9
# File 'lib/automux/controller/support/rendering.rb', line 6

def render(view)
  path = deduce_full_path(view)
  render_file(path)
end

#render_file(path) ⇒ Object

There are two requirements to render a file.

  1. @binding

  2. file_name



14
15
16
17
18
# File 'lib/automux/controller/support/rendering.rb', line 14

def render_file(path)
  result = Automux::Library::MiniErb.new(File.read(path)).result(@binding)
  modified_result = remove_empty_lines(result)
  environmental_execute modified_result
end