Skip to content

Instantly share code, notes, and snippets.

@Sunnyztj
Created January 10, 2014 03:36
Show Gist options
  • Save Sunnyztj/8346610 to your computer and use it in GitHub Desktop.
Save Sunnyztj/8346610 to your computer and use it in GitHub Desktop.
rails s api
1. update:
api:
put :update do
authenticate!
if current_user.update_attributes params[:user]
current_user
else
error!({ error: current_user.errors.full_messages }, 422)
end
end
postman:
X-USER-ACCESS-TOKEN FMsqf6AG5ZnxqBbuqnqT
user[first_name] ben
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment