Created
February 26, 2013 03:11
-
-
Save mgonto/5035552 to your computer and use it in GitHub Desktop.
Json controller
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UsersController < ApplicationController | |
respond_to :json | |
before_filter :authenticate_user!, :only => :destroy | |
def create | |
@user = User.new(params[:user]) | |
if @user.save | |
respond_with @user, status: :created | |
else | |
render json: @user.errors, status: :unprocessable_entity | |
end | |
end | |
def destroy | |
end | |
def login | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment