Permalink
Browse files

return :default sorting option when specified and nothing in session

  • Loading branch information...
1 parent f5f19e6 commit e822c96bf42e89b2daf0381e9f9892c59ae8602a @kennon kennon committed Apr 26, 2010
Showing with 2 additions and 0 deletions.
  1. +2 −0 lib/sortable_columns.rb
View
2 lib/sortable_columns.rb
@@ -11,6 +11,8 @@ def sortable_order(sortable, options = {})
if session[:sortable_columns] && session[:sortable_columns][sortable.to_s.downcase.to_sym]
column = session[:sortable_columns][sortable.to_s.downcase.to_sym].keys.first
return "#{column.to_s} #{session[:sortable_columns][sortable.to_s.downcase.to_sym][column.to_sym]}"
+ else
+ return options[:default]
end
end
end

0 comments on commit e822c96

Please sign in to comment.