Skip to content

Instantly share code, notes, and snippets.

@PerezIgnacio
Last active February 3, 2020 13:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PerezIgnacio/d049e6bbb175de521d8456dcc7daf7e2 to your computer and use it in GitHub Desktop.
Save PerezIgnacio/d049e6bbb175de521d8456dcc7daf7e2 to your computer and use it in GitHub Desktop.
RegistrationsController example using form object
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