Module: Roger::Template::Helpers::Partial

Included in:
TemplateContext
Defined in:
lib/roger/template/helpers/partial.rb

Overview

The partial helper

Instance Method Summary collapse

Instance Method Details

#partial(name, locals = {}, &block) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/roger/template/helpers/partial.rb', line 6

def partial(name, locals = {}, &block)
  options = if locals[:locals]
              locals
            else
              { locals: locals }
            end
  if block_given?
    partial_with_block(name, options, &block)
  else
    renderer.render(name, options)
  end
end