Class: ActionView::TemplateHandlers::ErubisHandler
- Inherits:
-
TemplateHandler
- Object
- TemplateHandler
- ActionView::TemplateHandlers::ErubisHandler
- 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
-
#_preprocessing_context_object ⇒ Object
:nodoc:.
-
#cache_fragment(block, name = {}, options = nil) ⇒ Object
:nodoc:.
- #compile(template) ⇒ Object
-
#logger ⇒ Object
:nodoc:.
Methods included from Erubis::PreprocessingHelper
Methods included from Erubis::Helpers::RailsHelper::TemplateConverter
#_convert_template, #_create_preprocessor, #_logger_info
Instance Method Details
#_preprocessing_context_object ⇒ Object
: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 = {}, = nil) #:nodoc: @view.fragment_for(block, name, ) 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 |
#logger ⇒ Object
:nodoc:
182 183 184 |
# File 'lib/erubis/helpers/rails_helper.rb', line 182 def logger #:nodoc: return @view.controller.logger end |