Class: ActionView::TemplateHandlers::ERB

Inherits:
ActionView::TemplateHandler show all
Includes:
Compilable
Defined in:
lib/action_view/template_handlers/erb.rb

Instance Method Summary collapse

Methods included from Compilable

#compile_template, included, #render

Methods inherited from ActionView::TemplateHandler

#compilable?, compilable?, #initialize, line_offset, #line_offset, #render

Constructor Details

This class inherits a constructor from ActionView::TemplateHandler

Instance Method Details

#cache_fragment(block, name = {}, options = nil) ⇒ Object

:nodoc:



49
50
51
52
53
# File 'lib/action_view/template_handlers/erb.rb', line 49

def cache_fragment(block, name = {}, options = nil) #:nodoc:
  @view.fragment_for(block, name, options) do
    eval(ActionView::Base.erb_variable, block.binding)
  end
end

#compile(template) ⇒ Object



45
46
47
# File 'lib/action_view/template_handlers/erb.rb', line 45

def compile(template)
  ::ERB.new(template.source, nil, @view.erb_trim_mode).src
end