I have a form with: remote => true, which means it will be submitted via ajax.
In the controller, I have this code:
before_filter: authenticate_user!, :only => [:create]
I only allow the verified user to create the resource.
However, when authentication fails, devise will raise
Completed 401 Unauthorized
and unobtrusive javascript will not be displayed.
But I hope that everything will be like this:
Come up with some posts in flash and make my .js.erb, then I will show Flash to users.
How to do it?
source share