add pool sort option

This commit is contained in:
albert
2013-02-17 15:43:44 -05:00
parent 327ad8fbb6
commit 351e4d426a
2 changed files with 12 additions and 0 deletions

View File

@@ -40,6 +40,12 @@ class Pool < ActiveRecord::Base
q = q.where("creator_id = ?", params[:creator_id].to_i)
end
if params[:sort] == "updated_at"
q = q.order("updated_at desc")
else
q = q.order("name")
end
q
end
end