Module: BootstrapHelp::NavHelpers

Includes:
ActionView::Context, ActionView::Helpers::TagHelper, ActionView::Helpers::TextHelper, ActionView::Helpers::UrlHelper
Defined in:
lib/bootstrap_help/nav_helpers.rb

Instance Method Summary collapse

Instance Method Details



43
44
45
# File 'lib/bootstrap_help/nav_helpers.rb', line 43

def dropdown_divider
  (:li, nil, :class => "divider")
end


31
32
33
34
35
36
# File 'lib/bootstrap_help/nav_helpers.rb', line 31

def dropdown_menu(menu_name, &block)
   :li, :class => "dropdown" do
    dropdown_link(menu_name) +
    (:ul, :class => "dropdown-menu", &block)
  end
end

#left(&block) ⇒ Object



23
24
25
# File 'lib/bootstrap_help/nav_helpers.rb', line 23

def left(&block)
  (:div, class: 'nav', &block)
end


8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/bootstrap_help/nav_helpers.rb', line 8

def main_nav(args, &block)
  brand = args.fetch(:brand, '')
  brand_path = args.fetch(:brand_path, '/')

   :div, class: 'navbar navbar-fixed-top navbar-inverse' do
     :div, class: 'navbar-inner' do
       :div, class: 'container-fluid' do
        concat(responsive_menu_variation)
        concat(link_to(brand, brand_path, class: 'brand'))
        concat(capture(&block)) if block_given?
      end
    end
  end
end


39
40
41
# File 'lib/bootstrap_help/nav_helpers.rb', line 39

def menu_link_to(value, url, args=nil)
  (:li, link_to(value, url, args))
end

#right(&block) ⇒ Object



27
28
29
# File 'lib/bootstrap_help/nav_helpers.rb', line 27

def right(&block)
  (:div, class: 'nav pull-right', &block)
end