开发者

RJS with Devise gem

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜