Module: Interage::BootstrapHelper
- Included in:
- ApplicationHelper
- Defined in:
- lib/interage/bootstrap_helper.rb
Instance Method Summary collapse
- #bootstrap_alert(type, message) ⇒ Object
- #bootstrap_alert_danger(message) ⇒ Object
- #bootstrap_alert_default(message) ⇒ Object
- #bootstrap_alert_info(message) ⇒ Object
- #bootstrap_alert_not_found(gender, model) ⇒ Object
- #bootstrap_alert_not_found_female(model) ⇒ Object
- #bootstrap_alert_not_found_male(model) ⇒ Object
- #bootstrap_alert_success(message) ⇒ Object
- #bootstrap_alert_warning(message) ⇒ Object
- #text_not_found(gender, model) ⇒ Object
- #text_not_found_female(model) ⇒ Object
- #text_not_found_male(model) ⇒ Object
Instance Method Details
#bootstrap_alert(type, message) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/interage/bootstrap_helper.rb', line 5 def bootstrap_alert(type, ) icon = t("bootstrap.alert.icons.#{type}", default: type) content_tag :div, class: "no-margin alert alert-#{type}" do app_icon_text(icon, ) end end |
#bootstrap_alert_danger(message) ⇒ Object
29 30 31 |
# File 'lib/interage/bootstrap_helper.rb', line 29 def bootstrap_alert_danger() bootstrap_alert(:danger, ) end |
#bootstrap_alert_default(message) ⇒ Object
13 14 15 |
# File 'lib/interage/bootstrap_helper.rb', line 13 def bootstrap_alert_default() bootstrap_alert(:default, ) end |
#bootstrap_alert_info(message) ⇒ Object
17 18 19 |
# File 'lib/interage/bootstrap_helper.rb', line 17 def bootstrap_alert_info() bootstrap_alert(:info, ) end |
#bootstrap_alert_not_found(gender, model) ⇒ Object
33 34 35 |
# File 'lib/interage/bootstrap_helper.rb', line 33 def bootstrap_alert_not_found(gender, model) bootstrap_alert_info(text_not_found(gender, model)) end |
#bootstrap_alert_not_found_female(model) ⇒ Object
41 42 43 |
# File 'lib/interage/bootstrap_helper.rb', line 41 def bootstrap_alert_not_found_female(model) bootstrap_alert_not_found(:female, model) end |
#bootstrap_alert_not_found_male(model) ⇒ Object
37 38 39 |
# File 'lib/interage/bootstrap_helper.rb', line 37 def bootstrap_alert_not_found_male(model) bootstrap_alert_not_found(:male, model) end |
#bootstrap_alert_success(message) ⇒ Object
25 26 27 |
# File 'lib/interage/bootstrap_helper.rb', line 25 def bootstrap_alert_success() bootstrap_alert(:success, ) end |
#bootstrap_alert_warning(message) ⇒ Object
21 22 23 |
# File 'lib/interage/bootstrap_helper.rb', line 21 def bootstrap_alert_warning() bootstrap_alert(:warning, ) end |
#text_not_found(gender, model) ⇒ Object
45 46 47 48 49 50 |
# File 'lib/interage/bootstrap_helper.rb', line 45 def text_not_found(gender, model) default_not_found = t('bootstrap.alert.not_found', default: '') t("bootstrap.alert.#{gender}.not_found", model: tm(model).downcase, default: default_not_found) end |
#text_not_found_female(model) ⇒ Object
56 57 58 |
# File 'lib/interage/bootstrap_helper.rb', line 56 def text_not_found_female(model) text_not_found(:female, model) end |
#text_not_found_male(model) ⇒ Object
52 53 54 |
# File 'lib/interage/bootstrap_helper.rb', line 52 def text_not_found_male(model) text_not_found(:male, model) end |