Sha256: 63eeaa82a363e62e2f5a439d6f770bfb5c34a7b0ca27d7b4c70549cf567a9d90

Contents?: true

Size: 827 Bytes

Versions: 14

Compression:

Stored size: 827 Bytes

Contents

# -*- encoding : utf-8 -*-
#
# tagz.rb mixes quite easily with your favourite templating engine, avoiding
# the need for '<% rows.each do |row| %> ... <% row.each do |cell| %> '
# madness and other types of logic to be coded in the templating language,
# leaving templating to template engines and logic and looping to ruby -
# unencumbered by extra funky syntax.  in rails tagz will automatically be
# available in your erb templates.
#

require 'tagz'
include Tagz.globally

require 'erb'

rows = %w( a b c ), %w( 1 2 3 )

template = ERB.new <<-ERB
  <html>
    <body>
      <%=
        table_{
          rows.each do |row|
            tr_{
              row.each do |cell|
                td_{ cell }
              end
            }
          end
        }
      %>
    </body>
  </html>
ERB

puts template.result(binding)

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
tagz-9.11.0 samples/b.rb
tagz-9.10.0 samples/b.rb
tagz-9.9.2 samples/b.rb
tagz-9.9.1 samples/b.rb
tagz-9.9.0 samples/b.rb
tagz-9.7.0 samples/b.rb
tagz-9.6.2 samples/b.rb
tagz-9.6.1 samples/b.rb
tagz-9.6.0 samples/b.rb
tagz-9.5.0 samples/b.rb
tagz-9.4.0 samples/b.rb
tagz-9.3.0 samples/b.rb
tagz-9.2.0 samples/b.rb
tagz-9.1.0 samples/b.rb