Module: Buoys::Helper

Defined in:
lib/buoys/helper.rb

Instance Method Summary collapse

Instance Method Details

#buoy(key, *args) ⇒ Object Also known as: breadcrumb

Declare the breadcrumb which want to render in view.

<%= buoy :help, true %>



6
7
8
# File 'lib/buoys/helper.rb', line 6

def buoy(key, *args)
  @_buoys_renderer = Buoys::Renderer.new(self, key, *args)
end

#buoysObject Also known as: breadcrumbs

<% buoys.tap do |links| %>

<% if links.any? %>
  <ul>
    <% links.each do |link| %>
      <li class="<%= link.class %>">
        <%= link_to link.text, link.url %>
      </li>
    <% end %>
  </ul>
<% end %>

<% end %>



22
23
24
# File 'lib/buoys/helper.rb', line 22

def buoys
  buoys_renderer.render
end

#buoys_rendererObject



27
28
29
# File 'lib/buoys/helper.rb', line 27

def buoys_renderer
  @_buoys_renderer ||= Buoys::Renderer.new(self, nil)
end