Skip to content

Instantly share code, notes, and snippets.

@bretdavidson bretdavidson/test

Created Jun 30, 2016
Embed
What would you like to do?
def update
@computer = Computer.find_by mac_address: params[:id]
if @computer
if @computer.update_attributes(:status => params[:status])
render json: {:message => 'Computer Updated'}, status: 200
else
render json: {:errors => @computer.errors.full_messages}, status: 422
end
else
render json: {:message => 'Computer Not Found'}, status: 404
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.