Sha256: 4e8ca4591a0401f129d57627cbaff36fd20370109f61afd42d73b70e79010d0d

Contents?: true

Size: 598 Bytes

Versions: 17

Compression:

Stored size: 598 Bytes

Contents

# encoding: utf-8

module Rango
  module Helpers
    # tag :a, href: "/contact" { anchor }
    # tag :a, "contact", href: "/contact"
    # @since 0.0.2
    def tag(tag, content, attrs = Hash.new, &block)
      attrs, content = content, String.new if attrs.empty? && content.is_a?(Hash)
      block.call if block
      %[<#{tag} #{attrs.to_html_attrs}>#{content}</#{tag}>]
    end

    # @since 0.0.2
    def single_tag(tag, attrs = Hash.new)
      %[<#{tag} #{attrs.to_html_attrs} />]
    end
  end
end

require "rango/helpers/assets"
require "rango/helpers/syntax"
require "rango/helpers/general"

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
rango-0.2 lib/rango/helpers.rb
rango-0.1.1.3 lib/rango/helpers.rb
rango-0.1.1.2.11 lib/rango/helpers.rb
rango-0.1.1.2.10 lib/rango/helpers.rb
rango-0.1.1.2.9 lib/rango/helpers.rb
rango-0.1.1.2.8 lib/rango/helpers.rb
rango-0.1.1.2.7 lib/rango/helpers.rb
rango-0.1.1.2.6 lib/rango/helpers.rb
rango-0.1.1.2.5 lib/rango/helpers.rb
rango-0.1.1.2.4 lib/rango/helpers.rb
rango-0.1.1.2.3 lib/rango/helpers.rb
rango-0.1.1.2.2 lib/rango/helpers.rb
rango-0.1.1.2.1 lib/rango/helpers.rb
rango-0.2.pre lib/rango/helpers.rb
rango-0.1.1.2 lib/rango/helpers.rb
rango-0.1.1.1 lib/rango/helpers.rb
rango-0.1.1 lib/rango/helpers.rb