0

I am using devise, submitting all devise forms like sign up, login, forgot password forms in ajax way by adding remote: true. How I can handle displaying error messages and flash messages.

krishna m
  • 73
  • 1
  • 7

1 Answers1

0

Does this help you out?

Devise - Sign In with Ajax

Basically, you would send a 401 or similar status back with the response, then handle the error inside your ajax error function. From there you could append to a DOM element and style accordingly.

vinyl
  • 490
  • 4
  • 8
  • For all the actions like registrations, sessions, forgot password, resend confirmation do i need to do the same? – krishna m Mar 05 '19 at 06:47
  • I’d think you would approach it the same way. You just have to handle errors manually based on the response http status, as opposed to letting devise do it for you. – vinyl Mar 05 '19 at 07:02