Class: Mdm::Enrollment::DevicesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/mdm/management/devices_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



8
9
10
11
12
13
14
15
16
17
# File 'app/controllers/mdm/management/devices_controller.rb', line 8

def index
  @devices = Device.all
  render json: { devices: @devices.map { |device|
                   device.as_json(except: [
                                    :unlock_token,
                                    :push_magic
                                  ])
                 }
               }
end

#showObject



19
20
21
22
# File 'app/controllers/mdm/management/devices_controller.rb', line 19

def show
  @device = Device.find(params[:id])
  render json: { device: @device }
end