summaryrefslogtreecommitdiff
path: root/app/helpers/application_helper.rb
diff options
context:
space:
mode:
authorPeter Kozak <spag@golwen.net>2013-04-29 15:24:17 +0200
committerPeter Kozak <spag@golwen.net>2013-04-29 15:24:17 +0200
commit0317faf79380e706b72290939c6a0d46644b0ffe (patch)
treed2b1862ea088a26479cbcc32ba8babc7d43abd82 /app/helpers/application_helper.rb
parentd181daa525a730cc46c942845e5e2168858b7ef3 (diff)
return title if sort_descending is not defined
Diffstat (limited to 'app/helpers/application_helper.rb')
-rw-r--r--app/helpers/application_helper.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index b74fa27..7171fbb 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -20,6 +20,9 @@ module ApplicationHelper
end
def sortable(column, title)
+ if !defined?(sort_descending)
+ return title
+ end
link_class = (column.to_s == sort_column.to_s) ? "sort_descending #{sort_descending}" : nil
desc = (column.to_s == sort_column.to_s) ? !!(!sort_descending && column) : nil
link_to title, {:sort => column, :desc => desc, :type => @type}, {:class => link_class}