Module: Haml::Helpers::HamlbarsExtensions
- Included in:
- Haml::Helpers
- Defined in:
- lib/hamlbars/template.rb
Instance Method Summary collapse
-
#handlebars(expression, options = {}, &block) ⇒ Object
(also: #hb)
Used to create handlebars expressions within HAML, if you pass a block then it will create a Handlebars block helper (ie “{{#expression}..{/expression}” otherwise it will create an expression (ie “{expression}”)..
-
#handlebars!(expression, options = {}, &block) ⇒ Object
(also: #hb!)
The same as #handlebars except that it outputs “triple-stash” expressions, which means that Handlebars won’t escape the output.
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 (expression, ={}, &block) express(['{{','}}'],expression,,&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 (expression, ={}, &block) express(['{{{','}}}'],expression,,&block) end |