Skip to content

Commit

Permalink
Fix for passing cucumber test.
Browse files Browse the repository at this point in the history
  • Loading branch information
quark-zju committed Sep 25, 2012
1 parent 3e3ba66 commit a53c106
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions lib/active_admin/views/components/table_for.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,17 @@ def build_table_header(col)
classes = Arbre::HTML::ClassList.new
sort_key = sortable? && col.sortable? && col.sort_key

classes << 'sortable' if sort_key
classes << "sorted-#{current_sort[1]}" if current_sort[0] == sort_key
classes << col.data.to_s.downcase.underscore if col.data.is_a?(Symbol)
classes << col.title.downcase.underscore

th :class => classes do
sort_key ? link_to(col.title, params.merge(:order => "#{sort_key}_#{order_for_sort_key(sort_key)}").except(:page)) : col.title
classes << 'sortable' if sort_key
classes << "sorted-#{current_sort[1]}" if sort_key && current_sort[0] == sort_key
classes << col.data.to_s.downcase.underscore if col.data.is_a?(Symbol)
classes << col.title.to_s.downcase.underscore if col.title.class.in? [Symbol, String]

if sort_key
th :class => classes do
link_to(col.title, params.merge(:order => "#{sort_key}_#{order_for_sort_key(sort_key)}").except(:page))
end
else
th(col.title, :class => classes.to_s)
end
end

Expand Down

0 comments on commit a53c106

Please sign in to comment.