Module: Shoehorn::Helpers::NavigationHelpers

Defined in:
lib/shoehorn/helpers/navigation_helpers.rb

Instance Method Summary collapse

Instance Method Details

#bootstrap_navigation(options = {}) {|elements| ... } ⇒ Object

Render a navigation list

Examples

bootstrap_navigation(:type => "tabs", :stacked => true) do |nav|
  nav.link_to "Nav1", "/link1", :active_nav => true
  nav.link_to "Nav2", "/link2"
end

Returns HTML String for the navigation list

Parameters:

  • options (Hash) (defaults to: {})

    hash containing options (default: {}): :type - could be either ‘tabs’ or ‘pills’. Default is ‘tabs’. :stacked - if true, renders the navigation list in stacked mode.

Yields:

  • (elements)


19
20
21
22
23
24
25
26
27
28
# File 'lib/shoehorn/helpers/navigation_helpers.rb', line 19

def bootstrap_navigation(options = {})
  elements = Shoehorn::HelperCollection.new(self)

  yield elements

  Shoehorn::Components::Navigation.new(
    elements,
    options
  ).to_s
end