Move all order logic to models
- Have a default order for each model -- The overall default is ID DESC - Allow for custom orderings -- When comma-separated IDs are used
This commit is contained in:
@@ -3,7 +3,7 @@ class FavoriteGroupsController < ApplicationController
|
||||
respond_to :html, :xml, :json, :js
|
||||
|
||||
def index
|
||||
@favorite_groups = FavoriteGroup.search(params[:search]).order("updated_at desc").paginate(params[:page], :limit => params[:limit], :search_count => params[:search])
|
||||
@favorite_groups = FavoriteGroup.search(params[:search]).paginate(params[:page], :limit => params[:limit], :search_count => params[:search])
|
||||
respond_with(@favorite_groups) do |format|
|
||||
format.xml do
|
||||
render :xml => @favorite_groups.to_xml(:root => "favorite-groups")
|
||||
|
||||
Reference in New Issue
Block a user