Class: Ramaze::Template::Liquid

Inherits:
Template show all
Defined in:
lib/ramaze/template/liquid.rb

Overview

Is responsible for compiling a template using the Liquid templating engine. Can be found at: home.leetsoft.com/liquid

Class Method Summary collapse

Methods inherited from Template

caching_compile, reaction_or_file, render_method, result_and_file, wrap_compile

Methods included from Helper::Methods

extend_object, #helper, included

Class Method Details

.transform(action) ⇒ Object

initializes the handling of a request on the controller. Creates a new instances of itself and sends the action and params. Also tries to render the template. In Theory you can use this standalone, this has not been tested though.



23
24
25
26
27
28
29
30
31
32
# File 'lib/ramaze/template/liquid.rb', line 23

def transform action
  template = reaction_or_file(action)

  instance = action.instance
  hash     = instance.instance_variable_get("@hash") || {}
  template = ::Liquid::Template.parse(template)
  options  = instance.ancestral_trait[:liquid_options]

  template.render(hash, options)
end