Put sorting in web_link, page_context and design

This commit is contained in:
Christophe Vilayphiou committed 2012-05-05 21:20:20 +08:00
1 parent b48099d752
commit f190ce18ee
23 files changed
+130 -259

No files matched your search

+6 -2
View File
@@ -27,9 +27,13 @@ class OrbitBackendController< ApplicationController
end
end
def get_sorted_and_filtered(object_class)
def get_sorted_and_filtered(object_class, query=nil)
object_class = object_class.classify.constantize
objects = object_class.all
if query
objects = object_class.all.where(query)
else
objects = object_class.all
end
if !params[:sort].blank?
options = params[:sort_options]