summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorPeter Kozak <spag@golwen.net>2013-04-29 13:40:53 +0200
committerPeter Kozak <spag@golwen.net>2013-04-29 13:40:53 +0200
commit07e0df9203bbeae4b289add2c8b80de20a725637 (patch)
treef9e5573ea1c9ae3de19fae47be0fe2d8d56e8d3e /app
parent2978394123b7b84ff7be5b19309f6c43e43b8b0e (diff)
sortable helper method added
Diffstat (limited to 'app')
-rw-r--r--app/helpers/application_helper.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index de4d677..9334f7d 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -19,4 +19,9 @@ module ApplicationHelper
end
end
+ def sortable(column, title)
+ link_class = (column.to_s == sort_column.to_s) ? "sort_descending #{sort_descending}" : nil
+ link_to title, {:sort => column, :desc => !!(!sort_descending && column), :type => @type}, {:class => link_class}
+ end
+
end