Template rendering methods. Each method takes the name of a template to render as a Symbol and returns a String with the rendered output, as well as an optional hash with additional options.
`template` is either the name or path of the template as symbol (Use `:‘subdir/myview’` for views in subdirectories), or a string that will be rendered.
Possible options are:
:layout If set to false, no layout is rendered, otherwise the specified layout is used (Ignored for `sass` and `less`) :locals A hash with local variables that should be available in the template
# File lib/sinatra/base.rb, line 324 def builder(template=nil, options={}, locals={}, &block) options, template = template, nil if template.is_a?(Hash) template = Proc.new { block } if template.nil? render :builder, template, options, locals end
# File lib/sinatra/base.rb, line 300 def erb(template, options={}, locals={}) options[:outvar] = '@_out_buf' render :erb, template, options, locals end
# File lib/sinatra/base.rb, line 305 def erubis(template, options={}, locals={}) options[:outvar] = '@_out_buf' render :erubis, template, options, locals end
# File lib/sinatra/base.rb, line 310 def haml(template, options={}, locals={}) render :haml, template, options, locals end
Generated with the Darkfish Rdoc Generator 2.