Module: Interage::BootstrapAlertHelper
- Included in:
- ApplicationHelper
- Defined in:
- lib/interage/bootstrap_alert_helper.rb
Instance Method Summary collapse
- #bootstrap_alert(type, message) ⇒ Object (also: #bs_alert)
- #bootstrap_alert_danger(message) ⇒ Object (also: #bs_alert_danger)
- #bootstrap_alert_default(message) ⇒ Object (also: #bs_alert_default)
- #bootstrap_alert_info(message) ⇒ Object (also: #bs_alert_info)
- #bootstrap_alert_not_found(gender, model) ⇒ Object (also: #bs_text404)
- #bootstrap_alert_not_found_female(model) ⇒ Object (also: #bs_female404)
- #bootstrap_alert_not_found_male(model) ⇒ Object (also: #bs_male404)
- #bootstrap_alert_success(message) ⇒ Object (also: #bs_alert_success)
- #bootstrap_alert_warning(message) ⇒ Object (also: #bs_alert_warning)
- #default_not_found ⇒ Object (also: #default404)
- #text_not_found(gender, model) ⇒ Object (also: #text404)
- #text_not_found_female(model) ⇒ Object (also: #female404)
- #text_not_found_male(model) ⇒ Object (also: #male404)
Instance Method Details
#bootstrap_alert(type, message) ⇒ Object Also known as: bs_alert
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/interage/bootstrap_alert_helper.rb', line 5 def bootstrap_alert(type, ) icon = t("bootstrap.alert.icons.#{type}", default: type.to_s) subtitles = t("bootstrap.alert.subtitles.#{type}", default: '') tag.div class: "alert alert-#{type} m-0" do concat app_icon(icon) concat tag.b(" #{subtitles}: ") if subtitles.present? concat end end |
#bootstrap_alert_danger(message) ⇒ Object Also known as: bs_alert_danger
37 38 39 |
# File 'lib/interage/bootstrap_alert_helper.rb', line 37 def bootstrap_alert_danger() bs_alert(:danger, ) end |
#bootstrap_alert_default(message) ⇒ Object Also known as: bs_alert_default
17 18 19 |
# File 'lib/interage/bootstrap_alert_helper.rb', line 17 def bootstrap_alert_default() bs_alert(:default, ) end |
#bootstrap_alert_info(message) ⇒ Object Also known as: bs_alert_info
22 23 24 |
# File 'lib/interage/bootstrap_alert_helper.rb', line 22 def bootstrap_alert_info() bs_alert(:info, ) end |
#bootstrap_alert_not_found(gender, model) ⇒ Object Also known as: bs_text404
42 43 44 |
# File 'lib/interage/bootstrap_alert_helper.rb', line 42 def bootstrap_alert_not_found(gender, model) bs_alert_info(text404(gender, model)) end |
#bootstrap_alert_not_found_female(model) ⇒ Object Also known as: bs_female404
52 53 54 |
# File 'lib/interage/bootstrap_alert_helper.rb', line 52 def bootstrap_alert_not_found_female(model) bs_text404(:female, model) end |
#bootstrap_alert_not_found_male(model) ⇒ Object Also known as: bs_male404
47 48 49 |
# File 'lib/interage/bootstrap_alert_helper.rb', line 47 def bootstrap_alert_not_found_male(model) bs_text404(:male, model) end |
#bootstrap_alert_success(message) ⇒ Object Also known as: bs_alert_success
32 33 34 |
# File 'lib/interage/bootstrap_alert_helper.rb', line 32 def bootstrap_alert_success() bs_alert(:success, ) end |
#bootstrap_alert_warning(message) ⇒ Object Also known as: bs_alert_warning
27 28 29 |
# File 'lib/interage/bootstrap_alert_helper.rb', line 27 def bootstrap_alert_warning() bs_alert(:warning, ) end |
#default_not_found ⇒ Object Also known as: default404
64 65 66 |
# File 'lib/interage/bootstrap_alert_helper.rb', line 64 def default_not_found t('bootstrap.alert.not_found', default: '') end |
#text_not_found(gender, model) ⇒ Object Also known as: text404
57 58 59 60 61 |
# File 'lib/interage/bootstrap_alert_helper.rb', line 57 def text_not_found(gender, model) attributes = { model: tm(model).downcase, default: default404 } t("bootstrap.alert.#{gender}.not_found", **attributes) end |
#text_not_found_female(model) ⇒ Object Also known as: female404
74 75 76 |
# File 'lib/interage/bootstrap_alert_helper.rb', line 74 def text_not_found_female(model) text404(:female, model) end |
#text_not_found_male(model) ⇒ Object Also known as: male404
69 70 71 |
# File 'lib/interage/bootstrap_alert_helper.rb', line 69 def text_not_found_male(model) text404(:male, model) end |