Permalink
Browse files

fixed breadcrumbs

  • Loading branch information...
1 parent 38b668e commit 9334928435fe72b443416ecc9094e439fda65cd4 @tsonntag committed May 9, 2012
Showing with 10 additions and 5 deletions.
  1. +8 −5 lib/gitter/breadcrumbs.rb
  2. +2 −0 lib/gitter/drivers/active_record_driver.rb
View
@@ -9,17 +9,20 @@ module Breadcrumbs
def breadcrumbs
@breadcrumbs ||= begin
p = {}
- text = @filters_values.map do |filter, value|
- p[filter.label] = value
+ text = filters.map do |filter|
+ p[filter.label] = filter_value(filter.name)
end
p
end
end
- def render_breadcrumbs( join = '>' )
+ def render_breadcrumbs delim = '>'
+ delim_tag = h.content_tag :span, delim, {:class => 'breadcrumb_delim'}
+
@rendered_breadcrumbs ||= begin
p = {}
- text = @filters_values.map do |filter, value|
+ text = filters.map do |filter|
+ value = filter_value filter.name
if value.present?
s = h.content_tag :span, "#{filter.label} : ", :class => 'breadcrumb_key'
s += h.content_tag :span, value, :class => 'breadcrumb_value'
@@ -28,7 +31,7 @@ def render_breadcrumbs( join = '>' )
else
nil
end
- end.compact.join(join)
+ end.compact.join(delim_tag)
h.content_tag :span, text, {:class => 'breadcrumbs'}, false
end
end
@@ -16,6 +16,8 @@ def order attr, desc = nil
end
def unordered
+ puts "AAAAAAAAA scope: #{scope.to_sql}"
+ puts "AAAAAAAAA scope.except(:order): #{scope.except(:order).to_sql}"
new scope.except(:order)
end

0 comments on commit 9334928

Please sign in to comment.