Class: ActionView::TemplateHandlers::ErubisHandler

Inherits:
TemplateHandler
  • Object
show all
Includes:
Compilable, Erubis::Helpers::RailsHelper::TemplateConverter, Erubis::PreprocessingHelper
Defined in:
lib/erubis/helpers/rails_helper.rb,
lib/erubis/helpers/rails_helper.rb,
lib/erubis/helpers/rails_helper.rb

Instance Method Summary collapse

Methods included from Erubis::PreprocessingHelper

_P, _decode, _p

Methods included from Erubis::Helpers::RailsHelper::TemplateConverter

#_convert_template, #_create_preprocessor, #_logger_info

Instance Method Details

#_preprocessing_context_objectObject

:nodoc:



185
186
187
# File 'lib/erubis/helpers/rails_helper.rb', line 185

def _preprocessing_context_object  #:nodoc:
  return @view.controller.instance_variable_get('@template')
end

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

:nodoc:



189
190
191
192
193
194
# File 'lib/erubis/helpers/rails_helper.rb', line 189

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

#compile(template) ⇒ Object



153
154
155
156
# File 'lib/erubis/helpers/rails_helper.rb', line 153

def compile(template)
  #src = ::ERB.new("<% __in_erb_template=true %>#{template.source}", nil, erb_trim_mode, '@output_buffer').src
  return _convert_template("<% __in_erb_template=true %>#{template.source}")
end

#loggerObject

:nodoc:



182
183
184
# File 'lib/erubis/helpers/rails_helper.rb', line 182

def logger  #:nodoc:
  return @view.controller.logger
end