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`)
:locals A hash with local variables that should be available
in the template
Methods
- B
-
- E
-
- H
-
- S
-
Instance Public methods
builder(template=nil, options={}, locals={}, &block)
Source: show
| on GitHub
308: def builder(template=nil, options={}, locals={}, &block)
309: options, template = template, nil if template.is_a?(Hash)
310: template = Proc.new { block } if template.nil?
311: render :builder, template, options, locals
312: end
erb(template, options={}, locals={})
Source: show
| on GitHub
291: def erb(template, options={}, locals={})
292: render :erb, template, options, locals
293: end
erubis(template, options={}, locals={})
Source: show
| on GitHub
295: def erubis(template, options={}, locals={})
296: render :erubis, template, options, locals
297: end
haml(template, options={}, locals={})
Source: show
| on GitHub
299: def haml(template, options={}, locals={})
300: render :haml, template, options, locals
301: end
sass(template, options={}, locals={})
Source: show
| on GitHub
303: def sass(template, options={}, locals={})
304: options[:layout] = false
305: render :sass, template, options, locals
306: end