# -*- encoding : utf-8 -*-
module Admin::MagickOrderHelper


	def a_d(test=params[:a_d])
	  if test == "DESC"
	    "ASC"
	  else
	    "DESC"
	  end
  
	end



	def link_to_sort_results(text, row)

      new_params = {}


      new_params[:order] = row
      new_params[:a_d] = a_d
      params.each do |p|
	    new_params[p[0].to_sym] = p[1]
	  end
	  new_params[:order] = row
      new_params[:a_d] = a_d
      #:page => (params[:page] if params[:page])

	  link_to( text, url_for(new_params ), :remote => true, :style => ("font-weight:bold" if row == params[:order]))

	end
	
	
	
end
