Module: StandardView::MastheadHelper
- Defined in:
- app/helpers/standard_view/masthead_helper.rb
Instance Method Summary collapse
- #icon_with_text(icon_type, text) ⇒ Object
- #masthead_menu_link(destination, icon_type, text, class_name = nil, **options) ⇒ Object
- #masthead_menu_link_for_model(model_class) ⇒ Object
- #masthead_nav_link(destination, text, class_name = nil, **options) ⇒ Object
- #masthead_nav_link_for_model(model_class) ⇒ Object
Instance Method Details
#icon_with_text(icon_type, text) ⇒ Object
23 24 25 |
# File 'app/helpers/standard_view/masthead_helper.rb', line 23 def icon_with_text(icon_type, text) "#{icon_for(icon_type)} #{text}".html_safe end |
#masthead_menu_link(destination, icon_type, text, class_name = nil, **options) ⇒ Object
19 20 21 |
# File 'app/helpers/standard_view/masthead_helper.rb', line 19 def (destination, icon_type, text, class_name = nil, **) link_to(destination, class: "dropdown-item #{class_name}", **) { icon_with_text(icon_type, text) } end |
#masthead_menu_link_for_model(model_class) ⇒ Object
10 11 12 13 |
# File 'app/helpers/standard_view/masthead_helper.rb', line 10 def (model_class) list = Material::List.for(model_class) list.item_class, list.icon, list.list_title, active_for(controller: list.route_key) end |
#masthead_nav_link(destination, text, class_name = nil, **options) ⇒ Object
15 16 17 |
# File 'app/helpers/standard_view/masthead_helper.rb', line 15 def masthead_nav_link(destination, text, class_name = nil, **) link_to(destination, class: "nav-item nav-link #{class_name}", **) { text } end |
#masthead_nav_link_for_model(model_class) ⇒ Object
5 6 7 8 |
# File 'app/helpers/standard_view/masthead_helper.rb', line 5 def masthead_nav_link_for_model(model_class) list = Material::List.for(model_class) masthead_nav_link list.item_class, list.list_title, active_for(controller: list.route_key) end |