javascript - Devise with rails 3 and remote => true -


I have a problem planning with an AJAX login, I : remote = & gt; I am using the true option and the jQuery version of JavaScript assistants (https://github.com/rails/jquery-ujs). When the user enters the correct information, my create.js.erb is translated into session view. That's right, 'because I can redirect my user to this file. But when there is an error, eg The user enters false information, only a flash message is in response to the error code 401 - unauthorized , no view or not to make. Js.erb or sth is sung other. But I want to display this message on this side so that users get some feedback, which is wrong.

I played my custom controller with response_to: js , and the warden certification with the : recall method. But it does not work.

Does anyone know some best practices to solve this problem? Or should I avoid using this helpful methods and use pure jQuery for Ajax calls?

thx

3 "can be used. Just force the event in your form.

  jQuery (function ($) {$ ("# new_model"). Bind ("ajax: error", function (event, data, status, xhr) {warning ("something is wrong I went ");});});   

For more information about what events are available, refer to it.

Comments