Skip to content

Commit

Permalink
Added options to breadcrumb links, blacklisted backup files in .gitig…
Browse files Browse the repository at this point in the history
…nore
  • Loading branch information
aL3xa committed May 23, 2012
1 parent abbb56d commit f590483
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -3,3 +3,5 @@
Gemfile.lock
pkg/*
.DS_Store
*.swp
*~
20 changes: 10 additions & 10 deletions app/views/twitter-bootstrap/_breadcrumbs.html.erb
@@ -1,14 +1,14 @@
<% if @breadcrumbs %>
<ul class="breadcrumb">
<% separator = divider %>
<% @breadcrumbs[0..-2].each do |crumb| %>
<li>
<%= link_to crumb[:name], crumb[:url] %>
<span class="divider"><%= separator %></span>
</li>
<% if @breadcrumbs %>
<% @breadcrumbs[0..-2].each do |crumb| %>
<li>
<%= link_to crumb[:name], crumb[:url], crumb[:options] %>
<span class="divider"><%= separator %></span>
</li>
<% end %>
<li class="active">
<%= link_to @breadcrumbs.last[:name], @breadcrumbs.last[:url], @breadcrumbs.last[:options] %>
</li>
<% end %>
<li class="active">
<%= link_to @breadcrumbs.last[:name], @breadcrumbs.last[:url] %>
</li>
</ul>
<% end %>
4 changes: 2 additions & 2 deletions lib/twitter/bootstrap/rails/twitter-bootstrap-breadcrumbs.rb
Expand Up @@ -15,10 +15,10 @@ def add_breadcrumb name, url, options={}

protected

def add_breadcrumb name, url = ''
def add_breadcrumb name, url = '', options = {}
@breadcrumbs ||= []
url = eval(url) if url =~ /_path|_url|@/
@breadcrumbs << {:name => name, :url => url}
@breadcrumbs << {:name => name, :url => url, :options = options}
end

def render_breadcrumbs(divider = '/')
Expand Down

0 comments on commit f590483

Please sign in to comment.