Changed default sort order.
This commit is contained in:
parent
3d76ab5cd2
commit
81acdbb06a
2 changed files with 8 additions and 6 deletions
|
@ -19,13 +19,15 @@ class Index extends App.Controller
|
|||
@ajax(
|
||||
id: 'user_devices'
|
||||
type: 'GET'
|
||||
url: @apiPath + '/user_devices'
|
||||
url: "#{@apiPath}/user_devices"
|
||||
success: (data) =>
|
||||
@render(data)
|
||||
)
|
||||
|
||||
render: (data) =>
|
||||
@html App.view('profile/devices')( devices: data )
|
||||
@html App.view('profile/devices')(
|
||||
devices: data
|
||||
)
|
||||
|
||||
delete: (e) =>
|
||||
e.preventDefault()
|
||||
|
|
|
@ -4,7 +4,7 @@ class UserDevicesController < ApplicationController
|
|||
before_action :authentication_check
|
||||
|
||||
def index
|
||||
devices = UserDevice.where(user_id: current_user.id).order('created_at DESC')
|
||||
devices = UserDevice.where(user_id: current_user.id).order('updated_at DESC, name ASC')
|
||||
devices_full = []
|
||||
devices.each {|device|
|
||||
attributes = device.attributes
|
||||
|
|
Loading…
Reference in a new issue