简体   繁体   English

Rails Devise-注销错误ActionController :: InvalidAuthenticityToken

[英]Rails Devise - Logout error ActionController::InvalidAuthenticityToken

I am using Devise and trying to build the Logout link to logout of the user session. 我正在使用Devise,并尝试构建注销链接以注销用户会话。

I have included jquery-ujs file in the template and its loading correctly. 我已经在模板中包含了jquery-ujs文件,并且其加载正确。

This is my Logout link 这是我的注销链接

<%= link_to "Sign Out", destroy_user_session_path, :method => :delete %>

But when i click the link i am getting the following error 但是,当我单击链接时,出现以下错误

ActionController::InvalidAuthenticityToken at /users/sign_out

ActionController::InvalidAuthenticityToken

If you need the authenticity token, then provide it. 如果您需要真实性令牌,请提供它。

<%= form_tag destroy_user_session_path, method: :delete do |f| %>
  <%= f.submit 'Sign Out' %>
<% end %>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Rails 5 +设计:ActionController :: InvalidAuthenticityToken - Rails 5 + Devise: ActionController::InvalidAuthenticityToken 设计错误-ActionController :: InvalidAuthenticityToken - Devise error - ActionController::InvalidAuthenticityToken Rails错误:ActionController :: InvalidAuthenticityToken - Rails Error: ActionController::InvalidAuthenticityToken Rails的ActionController :: InvalidAuthenticityToken错误 - Rails ActionController::InvalidAuthenticityToken error Rails 5 ActionController :: InvalidAuthenticityToken错误 - Rails 5 ActionController::InvalidAuthenticityToken error Rails中的ActionController :: InvalidAuthenticityToken错误 - ActionController::InvalidAuthenticityToken error in rails 获取用于设计登录和注册的ActionController :: InvalidAuthenticityToken(ActionController :: InvalidAuthenticityToken)错误 - Getting ActionController::InvalidAuthenticityToken (ActionController::InvalidAuthenticityToken) error for devise sign in and sign up 摆脱ActionController :: InvalidAuthenticityToken(Rails 3,webrick,devise) - Getting rid of ActionController::InvalidAuthenticityToken (Rails 3, webrick, devise) ActionController::InvalidAuthenticityToken Rails 5 / 设计 / 审计 / PaperTrail gem - ActionController::InvalidAuthenticityToken Rails 5 / Devise / Audited / PaperTrail gem Rails4 ActionController :: InvalidAuthenticityToken错误 - Rails4 ActionController::InvalidAuthenticityToken error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM