Skip to content

Instantly share code, notes, and snippets.

View neymarsabin's full-sized avatar
🏠
Working from home

Sabin neymarsabin

🏠
Working from home
View GitHub Profile
@neymarsabin
neymarsabin / registrations_controller.rb
Created September 8, 2017 05:50 — forked from jwo/registrations_controller.rb
API JSON authentication with Devise
class Api::RegistrationsController < Api::BaseController
respond_to :json
def create
user = User.new(params[:user])
if user.save
render :json=> user.as_json(:auth_token=>user.authentication_token, :email=>user.email), :status=>201
return
else