lib/formular/attributes.rb
def to_html
      map { |key, value|
        if value.is_a?(Hash)
          value.map { |k,v| %(#{key_to_attr_name(key)}-#{attribute_html(k, v)}) }.join(' ')
        else
          attribute_html(key, value)
        end
      }.join(' ')
    end
# converts the hash into a string k1=v1 k2=v2
# replaces underscores with - so we can use regular keys
# allows one layer of nested hashes so we can define data options as a hash.
converts the hash into a string k1=v1 k2=v2
replaces underscores with - so we can use regular keys
allows one layer of nested hashes so we can define data options as a hash.
converts the hash into a string k1 = v1 k2 = v2 replaces underscores with - so we can use regular keys allows one layer of nested hashes so we can define data options as a hash .
def to_html
      map { |key, value|
        if value.is_a?(Hash)
          value.map { |k,v| %(#{key_to_attr_name(key)}-#{attribute_html(k, v)}) }.join(' ')
        else
          attribute_html(key, value)
        end
      }.join(' ')
    end
def to_html map { | key , value | if value . is_a? ( Hash ) value . map { | k , v | %(#{key_to_attr_name(key)}-#{attribute_html(k, v)}) } . join ( ' ' ) else attribute_html ( key , value ) end } . join ( ' ' ) end
converts the hash into a string k1=v1 k2=v2
replaces underscores with - so we can use regular keys
allows one layer of nested hashes so we can define data options as a hash.
converts the hash into a string k1 = v1 k2 = v2 replaces underscores with - so we can use regular keys allows one layer of nested hashes so we can define data options as a hash .