Module: Odex::Templates::Helpers
- Defined in:
- lib/odex/modules/templates.rb
Instance Method Summary collapse
Instance Method Details
#render(template, locals = {}, options = {}, &block) ⇒ Object
7 8 9 10 11 |
# File 'lib/odex/modules/templates.rb', line 7 def render template, locals = {}, = {}, &block template_cache.fetch(template) do Slim::Template.new(template, ) end.render(self, locals, &block) end |
#template_cache ⇒ Object
13 14 15 |
# File 'lib/odex/modules/templates.rb', line 13 def template_cache Thread.current[:template_cache] ||= Tilt::Cache.new end |