Sha256: ed165a0de9ee601d9f391fdfea7b3ccf096385a8d6756e9c97dd5d613d824a77

Contents?: true

Size: 379 Bytes

Versions: 1

Compression:

Stored size: 379 Bytes

Contents

module HungryForm
  module Rails
    module Renderable
      def html_class
        classes = []
        classes << attributes[:class] if attributes[:class]
        classes << 'hidden' unless visible?
        classes << 'invalid' if self.is_a?(HungryForm::Elements::Base::ActiveElement) && self.error.present?
        classes.join(' ') if classes.any?
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hungryform-rails-0.0.3 lib/hungryform/rails/renderable.rb