Sha256: a84372efafb5ac019d4ab5a60c1e9cf04466ef0c560467e72750ac5362b5ff67

Contents?: true

Size: 876 Bytes

Versions: 30

Compression:

Stored size: 876 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
      - elsif tab.fields.by_name(k.to_sym)
        - resource.class.human_attribute_name(k)
      - elsif assoc = resource.lolita.dbi.reflect_on_association(k.to_sym)
        - assoc.klass.lolita_model_name.human
      - 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

30 entries across 30 versions & 1 rubygems

Version Path
lolita-4.0.11 app/views/components/lolita/configuration/tab/_error_msg.html.haml
lolita-4.0.10 app/views/components/lolita/configuration/tab/_error_msg.html.haml
lolita-4.0.9 app/views/components/lolita/configuration/tab/_error_msg.html.haml
lolita-4.0.8 app/views/components/lolita/configuration/tab/_error_msg.html.haml
lolita-4.0.7 app/views/components/lolita/configuration/tab/_error_msg.html.haml
lolita-4.0.6 app/views/components/lolita/configuration/tab/_error_msg.html.haml
lolita-4.0.5 app/views/components/lolita/configuration/tab/_error_msg.html.haml
lolita-4.0.4 app/views/components/lolita/configuration/tab/_error_msg.html.haml
lolita-4.0.3 app/views/components/lolita/configuration/tab/_error_msg.html.haml
lolita-4.0.2 app/views/components/lolita/configuration/tab/_error_msg.html.haml
lolita-4.0.1 app/views/components/lolita/configuration/tab/_error_msg.html.haml
lolita-4.0.0 app/views/components/lolita/configuration/tab/_error_msg.html.haml
lolita-3.4.3 app/views/components/lolita/configuration/tab/_error_msg.html.haml
lolita-3.4.2 app/views/components/lolita/configuration/tab/_error_msg.html.haml
lolita-3.4.1 app/views/components/lolita/configuration/tab/_error_msg.html.haml
lolita-3.4.0 app/views/components/lolita/configuration/tab/_error_msg.html.haml
lolita-3.3.9 app/views/components/lolita/configuration/tab/_error_msg.html.haml
lolita-3.3.8 app/views/components/lolita/configuration/tab/_error_msg.html.haml
lolita-3.3.7 app/views/components/lolita/configuration/tab/_error_msg.html.haml
lolita-3.3.6 app/views/components/lolita/configuration/tab/_error_msg.html.haml