def manageable_sortable(column, title = nil, options = {})
      title ||= column.titleize

      if respond_to?(:sort_column) && respond_to?(:sort_direction)
        css_class = column && sort_column && column.to_sym == sort_column.to_sym ? "sort_#{sort_direction}" : nil
        direction = column && sort_column && column.to_sym == sort_column.to_sym && sort_direction == "asc" ? "desc" : "asc"
        options[:class] = [options[:class], css_class].compact.join(" ")

        link_to title, params.merge(:sort => column, :direction => direction, :page => nil), options
      else
        title
      end
    end
def manageable_sortable(column, title = nil, options = {})
      title ||= column.titleize

      if respond_to?(:sort_column) && respond_to?(:sort_direction)
        css_class = column && sort_column && column.to_sym == sort_column.to_sym ? "sort_#{sort_direction}" : nil
        direction = column && sort_column && column.to_sym == sort_column.to_sym && sort_direction == "asc" ? "desc" : "asc"
        options[:class] = [options[:class], css_class].compact.join(" ")

        link_to title, params.merge(:sort => column, :direction => direction, :page => nil), options
      else
        title
      end
    end
Links to a sortable column.
 *column*: - The column to link to
 *title*:  - The link title
 *options*: - Additional link_to options