Skip to content

Instantly share code, notes, and snippets.

@exocode
Created January 16, 2014 10:04
Show Gist options
  • Save exocode/8452499 to your computer and use it in GitHub Desktop.
Save exocode/8452499 to your computer and use it in GitHub Desktop.
<head>
<%= yield :title %>
</head>
<body>
<%= render_breadcrumbs %>
<%= yield # regular content %>
</body>
<div class="history-nav">
<% nav.each do |n| %>
<%= link_to n[:title], n[:url] %>
<% end %>
<%= link_to yield(:title), request.path, :class => 'no-link' %>
</div>
module BreadcrumbHelper
def breadcrumb_base
@navigation ||= [{:title => 'Home', :url => '/', :icon => 'home'}]
end
def breadcrumb_add(title, url, icon="asterisk")
breadcrumb_base << {:title => title, :url => url, :icon => icon}
end
def render_breadcrumbs
render :partial => 'partials/shared/breadcrumb', :locals => {:nav => breadcrumb_base}
end
end
<% breadcrumb_add 'My Parent Page Title', root_path, "user" # for additional breadcrumbs %>
<%= content_for :title, 'Contact' # set the page title and ending breadcrumb %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment