Module: BootstrapLeather::AlertsHelper
- Included in:
- ApplicationHelper
- Defined in:
- app/helpers/bootstrap_leather/alerts_helper.rb
Overview
Alerts, i.e. messages at the top of the page, usually from flash or form errors
Instance Method Summary collapse
- #alert(css_class, title, message = nil) ⇒ Object
- #alert_flash_messages(html_options = {}) ⇒ Object
- #flash_class(level) ⇒ Object
Instance Method Details
#alert(css_class, title, message = nil) ⇒ Object
18 19 20 21 22 23 24 25 26 27 |
# File 'app/helpers/bootstrap_leather/alerts_helper.rb', line 18 def alert(css_class, title, = nil) render( partial: 'bootstrap_leather/alerts/alert', locals: { css_class: css_class, title: title, message: } ) end |
#alert_flash_messages(html_options = {}) ⇒ Object
29 30 31 32 33 34 |
# File 'app/helpers/bootstrap_leather/alerts_helper.rb', line 29 def ( = {}) render( partial: 'bootstrap_leather/alerts/alert_flash_messages', locals: { html_options: } ) end |
#flash_class(level) ⇒ Object
7 8 9 10 11 12 13 14 15 16 |
# File 'app/helpers/bootstrap_leather/alerts_helper.rb', line 7 def flash_class(level) case level when :notice then 'info' when :error then 'danger' when :alert then 'warning' end end |