Sha256: 211194abfa6ea5b23c406b5b8fe0f8a85ffe5b3a143d3964fc17eebfb09ba5da

Contents?: true

Size: 801 Bytes

Versions: 1

Compression:

Stored size: 801 Bytes

Contents

<% if resource.errors.any? %>
  <p class="errorExplanation" id="errorExplanation">
    <%= raw resource.errors.keys.collect{|k|
      title = if k.to_s.match(/\./)
        assoc_name, attr_name = k.to_s.split(".")
        if tab.fields.by_name(attr_name.to_sym)
          klass = resource.lolita.dbi.reflect_on_association(assoc_name.to_sym).klass
          klass.human_attribute_name(attr_name).downcase
        end
      else
        if tab.fields.by_name(k.to_sym)
          resource.class.human_attribute_name(k)
        end
      end
      if title && resource.errors[k] && resource.errors[k].respond_to?(:any?) && resource.errors[k].any?
        "#{title.to_s.capitalize}: #{resource.errors[k].join(" #{::I18n.t("lolita.shared.and")} ")}"
      end
    }.compact.join("<br>") %>
  </p>
<% end %>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
lolita-3.2.0.rc.7 app/views/components/lolita/configuration/tab/_error_msg.html.erb