Guest User

Untitled

a guest
Feb 12th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.20 KB | None | 0 0
  1.   def sort_column
  2.     User.column_names.include?(params[:sort]) ? params[:sort] : "name"
  3.   end
  4.  
  5.   def sort_direction
  6.     %w[asc desc].include?(params[:direction]) ? params[:direction] : "asc"
  7.   end
Add Comment
Please, Sign In to add comment