Created
March 28, 2016 23:23
-
-
Save perezpaya/2546bc46b669ea959034 to your computer and use it in GitHub Desktop.
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 RegisterController < ApplicationController | |
def create | |
render json: UserService.new.register(registration_params) | |
rescue RegistrationError | |
render json: {message: 'User already registered'}, status_code: 422 | |
end | |
private | |
def registration_params | |
params.extract!(:name, :email) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment