Sha256: e5481091bcdad6cb18814621d2679ddef52849d882c56ea9e27d3d86448e0ef4

Contents?: true

Size: 769 Bytes

Versions: 5

Compression:

Stored size: 769 Bytes

Contents

- if resource.errors.any? 
  %p.errorExplanation{:id => "errorExplanation"}
    - errors = resource.errors.keys.collect do |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
      - else
        - if tab.fields.by_name(k.to_sym)
          - resource.class.human_attribute_name(k)
      - 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")} ")}"
    = raw(errors.compact.join("<br>"))

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
lolita-3.2.0.rc.13 app/views/components/lolita/configuration/tab/_error_msg.html.haml
lolita-3.2.0.rc.12 app/views/components/lolita/configuration/tab/_error_msg.html.haml
lolita-3.2.0.rc.11 app/views/components/lolita/configuration/tab/_error_msg.html.haml
lolita-3.2.0.rc.10 app/views/components/lolita/configuration/tab/_error_msg.html.haml
lolita-3.2.0.rc.9 app/views/components/lolita/configuration/tab/_error_msg.html.haml