Sha256: 8f4df400966d5ae9b427625985e4291fdf06169205eb9078ac9cb549783a6d55

Contents?: true

Size: 354 Bytes

Versions: 10

Compression:

Stored size: 354 Bytes

Contents

module BulmaFormBuilder
  module Components
    module Validation
      extend ActiveSupport::Concern

      private

      def error?(name)
        object.respond_to?(:errors) && !(name.nil? || object.errors[name].empty?)
      end

      def error_messages_for(name)
        object.errors.full_messages_for(name).join("\n")
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
bulma_form_builder-0.4.3 lib/bulma_form_builder/components/validation.rb
bulma_form_builder-0.4.2 lib/bulma_form_builder/components/validation.rb
bulma_form_builder-0.4.1 lib/bulma_form_builder/components/validation.rb
bulma_form_builder-0.4.0 lib/bulma_form_builder/components/validation.rb
bulma_form_builder-0.3.1 lib/bulma_form_builder/components/validation.rb
bulma_form_builder-0.3.0 lib/bulma_form_builder/components/validation.rb
bulma_form_builder-0.2.1 lib/bulma_form_builder/components/validation.rb
bulma_form_builder-0.2.0 lib/bulma_form_builder/components/validation.rb
bulma_form_builder-0.1.1 lib/bulma_form_builder/components/validation.rb
bulma_form_builder-0.1.0 lib/bulma_form_builder/components/validation.rb