Skip to content

Instantly share code, notes, and snippets.

View Shahor's full-sized avatar
🐢

Alexandre Gaudencio Shahor

🐢
View GitHub Profile
@Shahor
Shahor / registrations_controller.rb
Created December 7, 2012 15:53 — forked from evanbeard/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