Module: Golden::Theme::Bootstrap::AlertHelper

Defined in:
lib/golden/theme/bootstrap/alert_helper.rb

Instance Method Summary collapse

Instance Method Details

#bootstrap_alert_box(key, value) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/golden/theme/bootstrap/alert_helper.rb', line 3

def bootstrap_alert_box key, value
  alert_class = 'alert alert-dismissable'
  alert_class << case key.to_sym
  when :notice, :alert
    " alert-warning #{key}"
  when :error
    " alert-danger #{key}"
  else
    " alert-#{key} #{key}"
  end
  button_options = {
    type: 'button',
    name: nil,
    class: 'close',
    data: { dismiss: 'alert' }
  }
   :div, class: alert_class do
    concat button_tag('&times;'.html_safe, button_options)
    concat value
  end
end