class Tabnav::Navbar

Attributes

tab_content_partial[W]

Optionally specifies a partial to be used to render the tab content.

Public Instance Methods

add_sub_nav(options = {}, &block) click to toggle source

Creates a sub Navbar and adds it to the navbar.

options is an optional hash of options which will be used to create the li containing the sub navbar.

yields the created Navbar

# File lib/tabnav/navbar.rb, line 27
def add_sub_nav(options = {}, &block)
  add_item(Navbar, options, &block)
end
add_tab(options = {}, &block) click to toggle source

Creates a Tab and adds it to the navbar.

options is an optional hash of options which will be used to create the li for the tab.

yields the created Tab

# File lib/tabnav/navbar.rb, line 18
def add_tab(options = {}, &block)
  add_item(Tab, options, &block)
end

Private Instance Methods

add_item(klass, options) { |i| ... } click to toggle source
# File lib/tabnav/navbar.rb, line 44
def add_item(klass, options)
  options[:tab_content_partial] = @tab_content_partial if @tab_content_partial
  i = klass.new(@template, @params, options)
  yield i
  @tabs << i
end
render_tab() click to toggle source
Calls superclass method
# File lib/tabnav/navbar.rb, line 51
def render_tab
  super + render_navbar
end