Module: Maia::Controller

Extended by:
ActiveSupport::Concern
Defined in:
app/controllers/concerns/maia/controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



5
6
7
8
9
10
11
12
13
14
# File 'app/controllers/concerns/maia/controller.rb', line 5

def create
  if device_exists?
    @device = find_device
    update_device @device
  else
    @device = create_device_token
    send_dry_run_to current_user
  end
  respond_with @device
end

#destroyObject



16
17
18
19
20
# File 'app/controllers/concerns/maia/controller.rb', line 16

def destroy
  @device = find_device params[:id]
  @device.destroy
  respond_with @device
end