Class Padrino::Contrib::Helpers::Breadcrumb
In: lib/padrino-contrib/helpers/breadcrumbs.rb
Parent: Object

Methods

<<   add   del   new   reset   reset!   set_home  

Constants

DEFAULT_URL = "/"
DEFAULT_CAPTION = "Home Page"

Attributes

home  [RW] 
items  [RW] 

Public Class methods

Initialize breadcrumbs with default value.

@example

  before do
    @breadcrumbs = breadcrumbs.new
  end

Public Instance methods

<<(name, url, caption, options = {})

Alias for add

Add a new breadcrumbs.

@param [String] name

  The name of resource.

@param [Symbol] name

  The name of resource.

@param [String] url

  The url href.

@param [String] caption

  The text caption.

@param [Hash] options

  The HTML options to include in li.

@example

  breadcrumbs.add "foo", "/foo", "Foo Link", :id => "foo-id"
  breadcrumbs.add :foo, "/foo", "Foo Link", :class => "foo-class"

Remove a breadcrumb.

@param [String] name

 The name of resource to delete from breadcrumbs list.

@example

  breadcrumbs.del "foo"
  breadcrumbs.del :foo

Reset breadcrumbs to default or personal home.

@example

  breadcrumbs.reset

Reset breadcrumbs to default home.

@example

  breadcrumbs.reset!

Set the custom home (Parent) link.

@param [String] url

 The url href.

@param [String] caption

  The  text caption.

@param [Hash] options

  The HTML options to include in li.

@example

  breadcrumbs.set_home "/HomeFoo", "Foo Home", :id => "home-breadcrumb"

[Validate]