module FavoritesHelper def sortable(title, column) direction = column == sort_column && sort_direction == 'asc' ? 'desc' : 'asc' link_to title, :sort => column, :direction => direction end def sorting_arrow(column) if sort_column == column direction = column == sort_column && sort_direction == 'asc' ? 'desc' : 'asc' if direction == 'asc' image_tag 'up.png' else image_tag 'down.png' end end end end