Sha256: db796fc98848f0d72c0b3ef022248c7db9c88d11c8ded6f32157b7a7e1fb5291

Contents?: true

Size: 789 Bytes

Versions: 10

Compression:

Stored size: 789 Bytes

Contents

# frozen_string_literal: true

module BootstrapLeather
  # Alerts, i.e. messages at the top of the page, usually from flash
  # or form errors
  module AlertsHelper
    def flash_class(level)
      case level
      when :notice then
        'info'
      when :error then
        'danger'
      when :alert then
        'warning'
      end
    end

    def alert(css_class, title, message = nil)
      render(
        partial: 'bootstrap_leather/alerts/alert',
        locals: {
          css_class: css_class,
          title: title,
          message: message
        }
      )
    end

    def alert_flash_messages(html_options = {})
      render(
        partial: 'bootstrap_leather/alerts/alert_flash_messages',
        locals: { html_options: html_options }
      )
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
bootstrap_leather-0.10.14 app/helpers/bootstrap_leather/alerts_helper.rb
bootstrap_leather-0.10.13 app/helpers/bootstrap_leather/alerts_helper.rb
bootstrap_leather-0.10.11 app/helpers/bootstrap_leather/alerts_helper.rb
bootstrap_leather-0.10.10 app/helpers/bootstrap_leather/alerts_helper.rb
bootstrap_leather-0.10.9 app/helpers/bootstrap_leather/alerts_helper.rb
bootstrap_leather-0.10.8 app/helpers/bootstrap_leather/alerts_helper.rb
bootstrap_leather-0.10.7 app/helpers/bootstrap_leather/alerts_helper.rb
bootstrap_leather-0.10.6 app/helpers/bootstrap_leather/alerts_helper.rb
bootstrap_leather-0.10.5 app/helpers/bootstrap_leather/alerts_helper.rb
bootstrap_leather-0.10.4 app/helpers/bootstrap_leather/alerts_helper.rb