Class: RTeX::Framework::Rails::TemplateHandler
- Inherits:
-
ActionView::TemplateHandlers::ERB
- Object
- ActionView::TemplateHandlers::ERB
- RTeX::Framework::Rails::TemplateHandler
- Defined in:
- lib/rtex/framework/rails.rb
Instance Method Summary collapse
-
#compile(template) ⇒ Object
Due to significant changes in ActionView over the lifespan of Rails, tagging compiled templates to set a thread local variable flag seems to be the least brittle approach.
Instance Method Details
#compile(template) ⇒ Object
Due to significant changes in ActionView over the lifespan of Rails, tagging compiled templates to set a thread local variable flag seems to be the least brittle approach.
22 23 24 25 |
# File 'lib/rtex/framework/rails.rb', line 22 def compile(template) # Insert assignment, but not before the #coding: line, if present super.sub(/^(?!#)/m, "Thread.current[:_rendering_rtex] = true;\n") end |