blocks 1.2.4 → 1.2.5
Sign up to get free protection for your applications and to get access to all the features.
- data/app/views/blocks/_table.html.erb +2 -1
- metadata +1 -1
@@ -55,8 +55,9 @@
|
|
55
55
|
<% end %>
|
56
56
|
|
57
57
|
<%= table.define :header_sortable_link do |options| %>
|
58
|
+
<% order = options[:order] ? options[:order].to_s : options[:column].name.to_s %>
|
58
59
|
<% label = (options[:label] ? options[:label] : options[:column].name.to_s.titleize) %>
|
59
|
-
<% sort_mode = ((params[:order] !=
|
60
|
+
<% sort_mode = ((params[:order] != order or params[:sort_mode] == "desc") ? "asc" : "desc") %>
|
60
61
|
<% parameters = params.merge({:order => (options[:order] ? options[:order] : options[:column].name), :sort_mode => sort_mode}) %>
|
61
62
|
<% parameters.delete(:action); parameters.delete(:controller) %>
|
62
63
|
<% url = options[:sort_url] ? options[:sort_url] : "" %>
|