Put sorting in web_link, page_context and design
This commit is contained in:
1 parent
b48099d752
commit
f190ce18ee
23 files changed
+130
-259
No files matched your search
@@ -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]
|
||||
|
||||
Reference in new issue
Block a user