module LinkHelper

  def reversed_sort_param(field)
    (params[:sort][field.to_sym] == :desc) ? "#{field}" : "-#{field}"
  end

  def toggled_sort_param(field_1, field_2)
    params[:sort].keys.include?(field_1.to_sym) ? field_2.to_s : field_1.to_s
  end
end

module LinkHelper

  def reversed_sort_param(field, default = :asc)
    if default == :desc
      (params[:sort][field] == :desc) ? "#{field}" : "-#{field}"
    else
      (params[:sort][field] == :asc) ? "-#{field}" : "#{field}"
    end
  end

  def toggled_sort_param(field_1, field_2)
    params[:sort].keys.include?(field_1.to_s) ? field_2.to_s : field_1.to_s
  end
end

Update LinkHelper.reversed_sort_params to allow :asc or :desc default options.
Update LinkHelper.reversed_sort_params to allow :asc or :desc default options.
