Sha256: 928461e1d35784cbd11903bfa5616592121e4756ccada1b8e6ce8a0ac2b2af22

Contents?: true

Size: 984 Bytes

Versions: 2

Compression:

Stored size: 984 Bytes

Contents

-# Error mesages
-# Post.model_name.human              => activerecord.models.post
-# Post.human_attribute_name('title') => activerecord.attributes.post.title
- format = (format || TheNotification.config.default_type).to_s

- if object.try(:errors).try(:any?)
  - _errors = object.respond_to?(:localized_errors) ? object.localized_errors : object.errors
  - if format == 'html'
    .error_explanation.alert.alert-danger
      h4= t "the_notification.form_errors"
      ul
        - _errors.map do |name, msgs|
          - if msgs.is_a? Array
            - msgs.each do |msg|
              li
                strong= name
                '
                = msg
          - else
            li
              strong= name
              '
              = msgs

  - else
    = javascript_tag defer: :defer, type: "text/javascript" do
      | window.the_notifications = window.the_notifications || {};
      | window.the_notifications['errors'] = JSON.parse('#{ raw j _errors.to_json }');

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
the_notification-0.5.1 app/views/the_notification/_form.html.slim
the_notification-0.5.0 app/views/the_notification/_form.html.slim