Module: Haml::Helpers::HamlbarsExtensions

Included in:
Haml::Helpers
Defined in:
lib/hamlbars/template.rb

Instance Method Summary collapse

Instance Method Details

#handlebars(expression, options = {}, &block) ⇒ Object Also known as: hb

Used to create handlebars expressions within HAML, if you pass a block then it will create a Handlebars block helper (ie “Haml::Helpers::HamlbarsExtensions.{{#expression}..{/expression}” otherwise it will create an expression (ie “{expression}”).



80
81
82
# File 'lib/hamlbars/template.rb', line 80

def handlebars(expression, options={}, &block)
  express(['{{','}}'],expression,options,&block)
end

#handlebars!(expression, options = {}, &block) ⇒ Object Also known as: hb!

The same as #handlebars except that it outputs “triple-stash” expressions, which means that Handlebars won’t escape the output.



87
88
89
# File 'lib/hamlbars/template.rb', line 87

def handlebars!(expression, options={}, &block)
  express(['{{{','}}}'],expression,options,&block)
end