Module: Sinatra::Templates
- Defined in:
- lib/sinatra/jbuilder.rb
Instance Method Summary collapse
- #jbuilder(template, options = {}, locals = {}) ⇒ Object
- #render_with_view_path_support(engine, data, options = {}, locals = {}, &block) ⇒ Object (also: #render)
Instance Method Details
#jbuilder(template, options = {}, locals = {}) ⇒ Object
6 7 8 9 |
# File 'lib/sinatra/jbuilder.rb', line 6 def jbuilder(template, ={}, locals={}) [:default_content_type] = :json render :jbuilder, template, , 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, = {}, locals = {}, &block) # Same as `views` extraction in the original method. [:view_path] = [:views] || settings.views || "./views" if engine.to_s.downcase == "jbuilder" render_without_view_path_support(engine, data, , locals, &block) end |