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

Methods

erb   render_erb  

Public Instance methods

Renders erb within an event.

Inline example:

  get '/foo' do
    erb 'The time is <%= Time.now %>'
  end

Template example:

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

For options, see Sinatra::Renderer

See also: Sinatra::Renderer

[Source]

    # 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

[Source]

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

[Validate]