def sortable_column(attribute, default_direction = nil, options = nil)
      if options.nil? && (options = Hash.try_convert(default_direction))
        default_direction = nil
      end
      default_direction ||= 'desc'
      options ||= {}
      name = options[:name] || attribute.humanize
      selected = @table_sort_info[:attribute].to_s == attribute
      if selected
        direction = @table_sort_info[:direction]
        new_direction = direction.to_s == 'desc' ? 'asc' : 'desc'
        classes = "selected #{direction}"
      else
        classes = ''
        new_direction = default_direction
      end
      link_to(name, url_for(sort: "#{attribute}.#{new_direction}"), class: classes)
    end
def sortable_column(attribute, default_direction = nil, options = nil)
      if options.nil? && (options = Hash.try_convert(default_direction))
        default_direction = nil
      end
      default_direction ||= 'desc'
      options ||= {}
      name = options[:name] || attribute.humanize
      selected = @table_sort_info[:attribute].to_s == attribute
      if selected
        direction = @table_sort_info[:direction]
        new_direction = direction.to_s == 'desc' ? 'asc' : 'desc'
        classes = "selected #{direction}"
      else
        classes = ''
        new_direction = default_direction
      end
      link_to(name, url_for(sort: "#{attribute}.#{new_direction}"), class: classes)
    end
:call-seq:
   sortable_column(attribute, default_direction = 'desc', name: attribute.humanize)