Module: Sinatra::Templates

Defined in:
lib/sinatra/jbuilder.rb

Instance Method Summary collapse

Instance Method Details

#jbuilder(template, options = {}, locals = {}) ⇒ Object



6
7
8
9
# File 'lib/sinatra/jbuilder.rb', line 6

def jbuilder(template, options={}, locals={})
  options[:default_content_type] = :json
  render :jbuilder, template, options, locals
end

#render_with_view_path_support(engine, data, options = {}, locals = {}, &block) ⇒ Object Also known as: render



11
12
13
14
15
# File 'lib/sinatra/jbuilder.rb', line 11

def render_with_view_path_support(engine, data, options = {}, locals = {}, &block)
  # Same as `views` extraction in the original method.
  options[:view_path] = options[:views] || settings.views || "./views" if engine.to_s.downcase == "jbuilder"
  render_without_view_path_support(engine, data, options, locals, &block)
end