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