Last active
February 3, 2020 13:20
-
-
Save PerezIgnacio/d049e6bbb175de521d8456dcc7daf7e2 to your computer and use it in GitHub Desktop.
RegistrationsController example using form object
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 RegistrationsController < Devise::RegistrationsController | |
def create | |
form = UserRegistrationForm.new(params) | |
if form.save | |
# ... | |
else | |
render json: form.user.errors, status: :unprocessable_entity | |
end | |
end | |
# ... | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment