Closed Piioo closed 1 year ago
DeviseInvitable is not generating any json, that's must be done by rails or responders gem
The controller uses respond_with(resource) when It fails, and the resource will have validation errors. Then respond_with must be generating that structure. I think respond_with comes from responders gem, you may ask there how to customize json in case of errors.
I give a look in responders gem, i think you can create your own responder, and define json_resource_errors to change the structure. https://github.com/heartcombo/responders/blob/main/lib/action_controller/responder.rb
You can see how to use your own responder in the readme https://github.com/heartcombo/responders/tree/main#configuring-your-own-responder
Thanks
Hello,
I let return devise invitable the responses as json with own controller
respond_to :json
.How I may customise the structure of the error message like
{"errors":{"invitation_token":["ist nicht gültig"]}}
. I need an another structure.I cant find the place where this is build.