Module: BootstrapLeather::NavigationHelper

Included in:
ApplicationHelper
Defined in:
app/helpers/bootstrap_leather/navigation_helper.rb

Overview

Navigation

Instance Method Summary collapse

Instance Method Details



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_titleObject



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


13
14
15
16
17
18
19
# File 'app/helpers/bootstrap_leather/navigation_helper.rb', line 13

def nav_divider(options = {})
  options[:role] = 'separator'
  render(
    partial: 'bootstrap_leather/navigation/nav_divider',
    locals: { options: options }
  )
end


21
22
23
24
25
26
# File 'app/helpers/bootstrap_leather/navigation_helper.rb', line 21

def nav_heading(text, options = {})
  render(
    partial: 'bootstrap_leather/navigation/nav_heading',
    locals: { text: text, options: options }
  )
end


6
7
8
9
10
11
# File 'app/helpers/bootstrap_leather/navigation_helper.rb', line 6

def nav_item(text, href, options = {})
  render(
    partial: 'bootstrap_leather/navigation/nav_item',
    locals: { text: text, href: href, options: options }
  )
end


28
29
30
31
32
33
# File 'app/helpers/bootstrap_leather/navigation_helper.rb', line 28

def nav_list(html_options = {}, &block)
  render(
    partial: 'bootstrap_leather/navigation/nav_list',
    locals: { block: capture(&block), html_options: html_options }
  )
end


35
36
37
38
39
40
41
42
43
44
45
46
# File 'app/helpers/bootstrap_leather/navigation_helper.rb', line 35

def navbar(html_options = {}, &block)
  container_mode = html_options[:container_mode]
  html_options[:container_mode] = nil
  render(
    partial: 'bootstrap_leather/navigation/navbar',
    locals: {
      block: capture(&block),
      html_options: html_options,
      container_mode: container_mode
    }
  )
end


53
54
55
56
# File 'app/helpers/bootstrap_leather/navigation_helper.rb', line 53

def navbar_in_container(html_options = {}, &block)
  html_options[:container_mode] = :in
  navbar(html_options, &block)
end


48
49
50
51
# File 'app/helpers/bootstrap_leather/navigation_helper.rb', line 48

def navbar_with_container(html_options = {}, &block)
  html_options[:container_mode] = :with
  navbar(html_options, &block)
end