Module: BootstrapLeather::NavigationHelper
- Included in:
- ApplicationHelper
- Defined in:
- app/helpers/bootstrap_leather/navigation_helper.rb
Overview
Navigation
Instance Method Summary collapse
- #dropdown_nav_item(text, href, active = false, &block) ⇒ Object
- #logo_and_title ⇒ Object
- #nav_divider(options = {}) ⇒ Object
- #nav_heading(text, options = {}) ⇒ Object (also: #nav_header)
- #nav_item(text, href, options = {}) ⇒ Object
- #nav_list(html_options = {}, &block) ⇒ Object
- #navbar(html_options = {}, &block) ⇒ Object (also: #nav_bar)
- #navbar_in_container(html_options = {}, &block) ⇒ Object (also: #nav_bar_in_container)
- #navbar_with_container(html_options = {}, &block) ⇒ Object (also: #nav_bar_with_container)
Instance Method Details
#dropdown_nav_item(text, href, active = false, &block) ⇒ Object
58 59 60 61 62 63 64 65 66 67 68 |
# File 'app/helpers/bootstrap_leather/navigation_helper.rb', line 58 def dropdown_nav_item(text, href, active = false, &block) id = Time.now.to_f # Just to generate a unique id css_class = active ? 'active' : '' render( partial: 'bootstrap_leather/navigation/dropdown_nav_item', locals: { id: id, css_class: css_class, text: text, href: href, block: capture(&block) } ) end |
#logo_and_title ⇒ Object
70 71 72 |
# File 'app/helpers/bootstrap_leather/navigation_helper.rb', line 70 def logo_and_title render(partial: 'bootstrap_leather/navigation/logo_and_title') end |
#nav_divider(options = {}) ⇒ Object
13 14 15 16 17 18 19 |
# File 'app/helpers/bootstrap_leather/navigation_helper.rb', line 13 def nav_divider( = {}) [:role] = 'separator' render( partial: 'bootstrap_leather/navigation/nav_divider', locals: { options: } ) end |
#nav_heading(text, options = {}) ⇒ Object Also known as:
21 22 23 24 25 26 |
# File 'app/helpers/bootstrap_leather/navigation_helper.rb', line 21 def nav_heading(text, = {}) render( partial: 'bootstrap_leather/navigation/nav_heading', locals: { text: text, options: } ) end |
#nav_item(text, href, options = {}) ⇒ Object
6 7 8 9 10 11 |
# File 'app/helpers/bootstrap_leather/navigation_helper.rb', line 6 def nav_item(text, href, = {}) render( partial: 'bootstrap_leather/navigation/nav_item', locals: { text: text, href: href, options: } ) end |
#nav_list(html_options = {}, &block) ⇒ Object
28 29 30 31 32 33 |
# File 'app/helpers/bootstrap_leather/navigation_helper.rb', line 28 def nav_list( = {}, &block) render( partial: 'bootstrap_leather/navigation/nav_list', locals: { block: capture(&block), html_options: } ) end |
#navbar(html_options = {}, &block) ⇒ Object Also known as:
35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'app/helpers/bootstrap_leather/navigation_helper.rb', line 35 def ( = {}, &block) container_mode = [:container_mode] [:container_mode] = nil render( partial: 'bootstrap_leather/navigation/navbar', locals: { block: capture(&block), html_options: , container_mode: container_mode } ) end |
#navbar_in_container(html_options = {}, &block) ⇒ Object Also known as:
53 54 55 56 |
# File 'app/helpers/bootstrap_leather/navigation_helper.rb', line 53 def ( = {}, &block) [:container_mode] = :in (, &block) end |
#navbar_with_container(html_options = {}, &block) ⇒ Object Also known as:
48 49 50 51 |
# File 'app/helpers/bootstrap_leather/navigation_helper.rb', line 48 def ( = {}, &block) [:container_mode] = :with (, &block) end |