Files
libr-2/app/controllers/api/v1/registrations_controller.rb
2015-08-19 23:41:59 +08:00

18 lines
383 B
Ruby

class Api::V1::RegistrationsController < Api::V1::ApplicationController
skip_before_action :authenticate_user_from_token
respond_to :json
def create
params.permit!
user = User.new(params[:user])
if user.save
render json: user_json(user), status: :created
else
warden.custom_failure!
render json: user.errors, status: 422
end
end
end