Module: FoxPage::Helpers::RenderHelper

Defined in:
lib/fox_page/helpers/render_helper.rb

Instance Method Summary collapse

Instance Method Details

#render(view, params = {}) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/fox_page/helpers/render_helper.rb', line 6

def render(view, params = {})
  full_path = Dir.glob(app.root.join("app/views/#{view}.*")).first

  unless full_path
    raise ArgumentError, "Could not find template for #{view}"
  end

  Tilt.new(full_path).render(self, params)
end