Sha256: 22f871b1a43ff029145bca910ca80ac7b8ee7d92f40acec2b3e43c20e505b03d

Contents?: true

Size: 641 Bytes

Versions: 32

Compression:

Stored size: 641 Bytes

Contents

module DeviseBootstrapErrorsHelper
  def devise_bootstrap_error_messages!
    return '' if resource.errors.empty?

    messages = resource.errors.full_messages.map { |msg| content_tag(:li, msg) }.join
    sentence = I18n.t('errors.messages.not_saved',
                      count: resource.errors.count,
                      resource: resource.class.model_name.human.downcase)

    html = <<-HTML
    <div class="alert alert-danger alert-block devise-bs">
      <button type="button" class="close" data-dismiss="alert">&times;</button>
      <h5>#{sentence}</h5>
      <ul>#{messages}</ul>
    </div>
    HTML

    html.html_safe
  end
end

Version data entries

32 entries across 32 versions & 2 rubygems

Version Path
thecore_ui_rails_admin-2.2.7 app/helpers/devise_bootstrap_errors_helper.rb
thecore_ui_rails_admin-2.2.6 app/helpers/devise_bootstrap_errors_helper.rb
thecore_ui_rails_admin-2.2.5 app/helpers/devise_bootstrap_errors_helper.rb
thecore_ui_rails_admin-2.2.4 app/helpers/devise_bootstrap_errors_helper.rb
thecore_ui_rails_admin-2.2.3 app/helpers/devise_bootstrap_errors_helper.rb
thecore_ui_rails_admin-2.2.2 app/helpers/devise_bootstrap_errors_helper.rb
thecore_ui_rails_admin-2.2.1 app/helpers/devise_bootstrap_errors_helper.rb
thecore_ui_rails_admin-2.2.0 app/helpers/devise_bootstrap_errors_helper.rb
thecore_ui_rails_admin-2.1.22 app/helpers/devise_bootstrap_errors_helper.rb
thecore_ui_rails_admin-2.1.21 app/helpers/devise_bootstrap_errors_helper.rb
thecore_ui_rails_admin-2.1.20 app/helpers/devise_bootstrap_errors_helper.rb
thecore_ui_rails_admin-2.1.19 app/helpers/devise_bootstrap_errors_helper.rb
thecore_ui_rails_admin-2.1.18 app/helpers/devise_bootstrap_errors_helper.rb
thecore_ui_rails_admin-2.1.17 app/helpers/devise_bootstrap_errors_helper.rb
thecore_ui_rails_admin-2.1.16 app/helpers/devise_bootstrap_errors_helper.rb
thecore_ui_rails_admin-2.1.15 app/helpers/devise_bootstrap_errors_helper.rb
thecore_ui_rails_admin-2.1.14 app/helpers/devise_bootstrap_errors_helper.rb
thecore_ui_rails_admin-2.1.13 app/helpers/devise_bootstrap_errors_helper.rb
thecore_ui_rails_admin-2.1.12 app/helpers/devise_bootstrap_errors_helper.rb
thecore_ui_rails_admin-2.1.11 app/helpers/devise_bootstrap_errors_helper.rb