Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class PeopleController < ApplicationController
- def show
- @person = Person.find params[:id]
- end
- def update
- @person = Person.find params[:id]
- @person.update_attributes params[:person]
- if @person.valid?
- render :json => @person, :status => 200
- else
- render :json => {:errors => @person.errors.full_messages}, :status => 422
- end
- end
- end
Add Comment
Please, Sign In to add comment