Sha256: 1c0302ccdf74a88b533db9f763a433820d98330416a534e2fdd469c62b87485e

Contents?: true

Size: 309 Bytes

Versions: 15

Compression:

Stored size: 309 Bytes

Contents

module Arbre
  module HTML

    class Attributes < Hash

      def to_html
        self.collect do |name, value|
          "#{html_escape(name)}=\"#{html_escape(value)}\""
        end.join(" ")
      end

      protected

      def html_escape(s)
        ERB::Util.html_escape(s)
      end
    end

  end
end

Version data entries

15 entries across 15 versions & 4 rubygems

Version Path
andrewroth_activeadmin-0.3.4.3 lib/active_admin/arbre/html/attributes.rb
andrewroth_activeadmin-0.3.4.2 lib/active_admin/arbre/html/attributes.rb
andrewroth_activeadmin-0.3.4.1 lib/active_admin/arbre/html/attributes.rb
andrewroth_activeadmin-0.3.4 lib/active_admin/arbre/html/attributes.rb
activeadmin-0.3.4 lib/active_admin/arbre/html/attributes.rb
activeadmin-0.3.3 lib/active_admin/arbre/html/attributes.rb
activeadmin-0.3.2 lib/active_admin/arbre/html/attributes.rb
activeadmin-0.3.1 lib/active_admin/arbre/html/attributes.rb
activeadmin-0.3.0 lib/active_admin/arbre/html/attributes.rb
nsm-activeadmin-0.2.2 lib/active_admin/arbre/attributes.rb
saulolso-activeadmin-0.2.2.1 lib/active_admin/arbre/attributes.rb
saulolso-activeadmin-0.2.2 lib/active_admin/arbre/attributes.rb
activeadmin-0.2.2 lib/active_admin/arbre/attributes.rb
activeadmin-0.2.1 lib/active_admin/arbre/attributes.rb
activeadmin-0.2.0 lib/active_admin/arbre/attributes.rb