1
2
3
4
5
6
order_value = case params[:order]
  when 'rating_ascend' then 'rating_average ASC'
  when 'rating_descend' then 'rating_average DESC'
  else 'distance ASC'
end
order = {:order => order_value}