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 %>



8
9
10
# File 'lib/buoys/helper.rb', line 8

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 %>



24
25
26
# File 'lib/buoys/helper.rb', line 24

def buoys
  buoys_renderer.render
end

#buoys_rendererObject



29
30
31
# File 'lib/buoys/helper.rb', line 29

def buoys_renderer
  @_buoys_renderer ||= Buoys::Renderer.new(self, nil) # rubocop:disable Naming/MemoizedInstanceVariableName
end