Sha256: 85bfe47979bf6ae91f66da190829046bee0849abb14c18788efb17acb402b11e

Contents?: true

Size: 599 Bytes

Versions: 6

Compression:

Stored size: 599 Bytes

Contents

# frozen_string_literal: true

module Katalyst
  module Content
    module Editor
      class Errors < Base
        def build(**options)
          turbo_frame_tag dom_id(container, :errors) do
            next unless container.errors.any?

            tag.div(class: "content-errors", **options) do
              tag.h2("Errors in content") +
                tag.ul(class: "errors") do
                  container.errors.each do |error|
                    concat(tag.li(error.message))
                  end
                end
            end
          end
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
katalyst-content-1.1.1 app/helpers/katalyst/content/editor/errors.rb
katalyst-content-1.1.0 app/helpers/katalyst/content/editor/errors.rb
katalyst-content-1.0.2 app/helpers/katalyst/content/editor/errors.rb
katalyst-content-1.0.1 app/helpers/katalyst/content/editor/errors.rb
katalyst-content-1.0.0 app/helpers/katalyst/content/editor/errors.rb
katalyst-content-0.2.2 app/helpers/katalyst/content/editor/errors.rb