Module: Xebec::ControllerSupport::InstanceMethods

Defined in:
lib/xebec/controller_support.rb

Instance Method Summary collapse

Instance Method Details

Declare and populate a navigation bar.

Examples:

nav_bar :tabs do |nb|
  nb.nav_item :overview, @project
  nb.nav_item :budget,   budget_project_path(@project)
  nb.nav_item :edit,     edit_project_path(@project)
end

Parameters:

  • name (String, Symbol) (defaults to: Xebec::NavBar::DEFAULT_NAME)

    the name of the navigation bar

Yields:

  • (Xebec::NavBar)

    nav_bar the navigation bar. The block is evaluated in the scope of the controller instance.

Returns:



69
70
71
# File 'lib/xebec/controller_support.rb', line 69

def nav_bar(name = Xebec::NavBar::DEFAULT_NAME, &block)
  look_up_nav_bar_and_eval name, &block
end