You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
562 B

class PeopleController < ApplicationController
skip_before_action :verify_authenticity_token
def index
render json: Person.all
end
def show
render json: Person.find(params["id"])
end
def create
if params["id"]
params["person"]["home_id"] = params["id"].to_i
end
render json: Person.create(params["person"])
end
def delete
render json: Person.delete(params["id"])
end
def update
render json: Person.update(params["id"], params["person"])
end
end