开发者

How to change devise's sign out to use POST instead of GET?

I noticed that the sign out action of devise uses GET (I think the best practice is to put all data state-changing actions behind a POST)

So how do I change the route to use a POST instead of a GET ? (Ideally without having to copy the controller code if at all that is needed)

Here's the rake route for the current devis开发者_如何学JAVAe sign out path (wrapped on two lines):

destroy_user_session GET    /users/sign_out(.:format)
         {:controller=>"devise/sessions", :action=>"destroy"}


Found it! Latest devise version (v1.2.rc-10) has an option called :sign_out_via (link)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜