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(
|
@ajax(
|
||||||
id: 'user_devices'
|
id: 'user_devices'
|
||||||
type: 'GET'
|
type: 'GET'
|
||||||
url: @apiPath + '/user_devices'
|
url: "#{@apiPath}/user_devices"
|
||||||
success: (data) =>
|
success: (data) =>
|
||||||
@render(data)
|
@render(data)
|
||||||
)
|
)
|
||||||
|
|
||||||
render: (data) =>
|
render: (data) =>
|
||||||
@html App.view('profile/devices')( devices: data )
|
@html App.view('profile/devices')(
|
||||||
|
devices: data
|
||||||
|
)
|
||||||
|
|
||||||
delete: (e) =>
|
delete: (e) =>
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
|
|
|
@ -4,7 +4,7 @@ class UserDevicesController < ApplicationController
|
||||||
before_action :authentication_check
|
before_action :authentication_check
|
||||||
|
|
||||||
def index
|
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_full = []
|
||||||
devices.each {|device|
|
devices.each {|device|
|
||||||
attributes = device.attributes
|
attributes = device.attributes
|
||||||
|
|
Loading…
Reference in a new issue