Create device controller with and API to create a device

- Turn of assets and helper generation automatically
This commit is contained in:
Yedhu Krishnan
2015-10-17 11:33:31 +05:30
parent 9c4800e217
commit 97bc55a518
4 changed files with 31 additions and 1 deletions

View File

@@ -0,0 +1,14 @@
class DevicesController < ApplicationController
respond_to :json
def create
device = Device.create(device_params)
respond_with device, status: :created
end
private
def device_params
params.require(:device).permit(:model, :unique_id, :imei_number)
end
end