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:
@@ -20,7 +20,7 @@ class DmailsController < ApplicationController
|
||||
cookies.permanent[:dmail_folder] = params[:folder]
|
||||
end
|
||||
@query = Dmail.active.visible.search(params[:search])
|
||||
@dmails = @query.order("dmails.created_at desc").paginate(params[:page], :limit => params[:limit])
|
||||
@dmails = @query.paginate(params[:page], :limit => params[:limit])
|
||||
respond_with(@dmails) do |format|
|
||||
format.xml do
|
||||
render :xml => @dmails.to_xml(:root => "dmails")
|
||||
|
||||
Reference in New Issue
Block a user