Sha256: 0f8e9ee5b780c226db468fc802226f31c585465085037b79bd51ddc2e7a099ed

Contents?: true

Size: 728 Bytes

Versions: 4

Compression:

Stored size: 728 Bytes

Contents

module Buoys
  module Helper
    # Declare the breadcrumb which want to render in view.
    #
    # <%= buoy :help, true %>
    def buoy(key, *args)
      @_buoys_renderer = Buoys::Renderer.new(self, key, *args)
    end
    alias breadcrumb buoy

    # <% 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 %>
    def buoys
      buoys_renderer.render
    end
    alias breadcrumbs buoys

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
buoys-0.6.0 lib/buoys/helper.rb
buoys-0.5.0 lib/buoys/helper.rb
buoys-0.4.0 lib/buoys/helper.rb
buoys-0.3.0 lib/buoys/helper.rb