Module: NavbarHelper
- Defined in:
- app/helpers/navbar_helper.rb
Instance Method Summary collapse
- #navbar(&block) ⇒ Object
- #navbar_button(text, target, options = {}) ⇒ Object
- #navbar_items(&block) ⇒ Object
- #navbar_right(&block) ⇒ Object
- #navbar_separator ⇒ Object
- #navigation_item(text, target, options = {}) ⇒ Object
Instance Method Details
#navbar(&block) ⇒ Object
4 5 6 |
# File 'app/helpers/navbar_helper.rb', line 4 def (&block) render(::Container::Component.new, &block) end |
#navbar_button(text, target, options = {}) ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'app/helpers/navbar_helper.rb', line 23 def (text, target, = {}) active = [:active] || request.path == target icon = [:icon] || nil method = [:method] || :get custom_class = [:class] || nil render(::Button::Component.new(target:, text:, icon:, method:, custom_class:)) end |
#navbar_items(&block) ⇒ Object
8 9 10 |
# File 'app/helpers/navbar_helper.rb', line 8 def (&block) render(::MenuItems::Component.new, &block) end |
#navbar_right(&block) ⇒ Object
12 13 14 |
# File 'app/helpers/navbar_helper.rb', line 12 def (&block) render(::RightSection::Component.new, &block) end |
#navbar_separator ⇒ Object
32 33 34 |
# File 'app/helpers/navbar_helper.rb', line 32 def render(::Separator::Component.new) end |
#navigation_item(text, target, options = {}) ⇒ Object
16 17 18 19 20 21 |
# File 'app/helpers/navbar_helper.rb', line 16 def (text, target, = {}) active = [:active] || request.path == target icon = [:icon] || nil render(::Navlink::Component.new(target:, text:, active:, icon:)) end |