【发布时间】:2013-10-23 11:15:18
【问题描述】:
我正在尝试使用 devise 注销但没有重定向!所以我想在注销后禁用重定向。这样做的原因是我想渲染某个模板。 如何在不重定向用户的情况下从设计中注销用户 --> 仅此方法 我已经覆盖了设计会话控制器。
我的方法(从 application_controller.rb 中的过滤器之前调用)
def check_concurrent_session
if user_signed_in?
if current_user && !(session[:token] == current_user.login_token)
render :template => "users/logout_duplex", :layout => "application", :locals => { sub_layout => "left" }
# The next line always redirects to signout_path
# I want to disable the complete redirect so it just logs out and shows the rendered template
Devise.sign_out_all_scopes ? sign_out : sign_out(@user)
return
end
end
end
【问题讨论】:
标签: ruby-on-rails-3 redirect devise render logout