Module Sinatra::Erb::EventContext
In: vendor/erb/lib/erb.rb


erb   render_erb  

Public Instance methods

Renders erb within an event.

Inline example:

  get '/foo' do
    erb 'The time is <%= %>'

Template example:

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

For options, see Sinatra::Renderer

See also: Sinatra::Renderer


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

Renders raw erb 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 erb


    # File vendor/erb/lib/erb.rb, line 12
12:       def render_erb(content)
13:         require 'erb'
14:         body
15:       end