Sha256: 1eb1524de90a5d7db579681700d2b7f583abcf2b02635e357217dd6818b9d14a

Contents?: true

Size: 800 Bytes

Versions: 17

Compression:

Stored size: 800 Bytes

Contents

#
# 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

17 entries across 17 versions & 2 rubygems

Version Path
ahoward-tagz-5.1.0 samples/b.rb
ahoward-tagz-6.0.0 samples/b.rb
ahoward-tagz-7.0.0 samples/b.rb
ahoward-tagz-7.1.0 samples/b.rb
tagz-9.0.0 samples/b.rb
tagz-8.2.0 samples/b.rb
tagz-8.1.0 samples/b.rb
tagz-8.0.0 samples/b.rb
tagz-7.2.2 samples/b.rb
tagz-7.2.3 samples/b.rb
tagz-7.2.1 samples/b.rb
tagz-7.2.0 samples/b.rb
tagz-6.0.0 samples/b.rb
tagz-7.0.0 samples/b.rb
tagz-7.1.0 samples/b.rb
tagz-5.0.0 samples/b.rb
tagz-5.0.1 samples/b.rb