What would be the proper way to set Devise gem (ruby on rails v3) in RJS style (example: http://railscasts.com/episodes/43-ajax-with-rjs)?
I usually create a create.js.erb file with alert(@error). When using devise I don'开发者_如何学运维t know how to properly get @error value. I would like to display all messages as javascript alerts.
I think, to achieve this you will need to write your own controllers (inherited from devise) and views. And then add respond_to :html, :js
to this controllers. After this, controllers will be able to respond to javascript requests and you can manage your alerts.
Read doc for how to create custom Devise views here: Devise
精彩评论