Guest User

Untitled

a guest
Sep 22nd, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. class PeopleController < ApplicationController
  2. def show
  3. @person = Person.find params[:id]
  4. end
  5.  
  6. def update
  7. @person = Person.find params[:id]
  8. @person.update_attributes params[:person]
  9.  
  10. if @person.valid?
  11. render :json => @person, :status => 200
  12. else
  13. render :json => {:errors => @person.errors.full_messages}, :status => 422
  14. end
  15. end
  16. end
Add Comment
Please, Sign In to add comment