Module Sinatra::Haml::EventContext
In: vendor/haml/lib/haml.rb


haml   render_haml  

Public Instance methods

Renders Haml within an event.

Inline example:

  get '/foo' do
    haml '== The time is #{}'

Template example:

  get '/foo' do
    haml :foo  #=> reads and renders view/foo.haml

For options, see Sinatra::Renderer

See also: Sinatra::Renderer


    # File vendor/haml/lib/haml.rb, line 34
34:       def haml(template, options = {}, &layout)
35:         render(template, :haml, options, &layout)
36:       end

Renders raw haml in within the events context.

This can be use to if you already have the template on hand and don‘t need a layout. This is speedier than using haml


    # File vendor/haml/lib/haml.rb, line 12
12:       def render_haml(template)
13:         require 'haml'
14:         body
15:       end