Sha256: 05e9b89cbf38a387f8daef7545a53335e0584dc1bbd9b7e75d7dcb606ce3180e

Contents?: true

Size: 305 Bytes

Versions: 13

Compression:

Stored size: 305 Bytes

Contents

require 'handlebars'

Handlebars.register_helper "table" do |block|
 "<table>#{block.call}</table>"
end

Handlebars.register_helper "row" do |block|
  "<tr class='awesome-row'>#{block.call}</tr>"
end

t = Handlebars.compile <<-HBS
{{#table width}}
  {{#row}}<td>Hi</td>{{/row}}
{{/table}}
HBS

puts t.call

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
handlebars-0.6.0 spike.rb
handlebars-0.5.0 spike.rb
handlebars-0.4.0 spike.rb
handlebars-0.3.2 spike.rb
handlebars-0.3.2beta4 spike.rb
handlebars-0.3.2beta3 spike.rb
handlebars-0.3.2beta2 spike.rb
handlebars-0.3.2beta1 spike.rb
handlebars-0.3.1 spike.rb
handlebars-0.3.0 spike.rb
handlebars-0.2.2 spike.rb
handlebars-0.2.1 spike.rb
handlebars-0.2.0 spike.rb