Sha256: d15534ec0ba0aa26ae9fb0ad5122da113628476df32ff30ec4c26aaff5dad24a

Contents?: true

Size: 738 Bytes

Versions: 1

Compression:

Stored size: 738 Bytes

Contents

require 'bootstrap_flash_messages/helpers'
require 'bootstrap_flash_messages/flash_messages'

module BootstrapFlashMessages
  @alert_class_mapping = { :notice => :success, :success => :success, :info => :info, :warning => :warning, :error => :danger }
  
  def self.alert_class_mapping(key)
    @alert_class_mapping[key.to_sym]
  end
  
  def self.initialize
    return if @initialized
    raise "ActionController is not available yet." unless defined?(ActionController)
    ActionController::Base.send(:helper, BootstrapFlashMessages::Helpers)
    ActionController::Base.send(:include, BootstrapFlashMessages::FlashMessages)
    @initialized = true
  end
end

if defined?(Rails::Railtie)
  require 'bootstrap_flash_messages/railtie'
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bootstrap_flash_messages-1.0.0 lib/bootstrap_flash_messages.rb