我正在使用 Authlogic gem 作为 rails 应用程序的身份验证系统。这是我在 UserSessionsController 中的代码
class UserSessionsController < ApplicationController
layout 'auth_layout'
def new
@user_session = UserSession.new
end
def create
@user_session = UserSession.new(params[:user_session])
if @user_session.save
flash[:notice] = "Login successful!"
else
render :action => :new
end
end
def destroy
current_user_session.destroy
redirect_to new_user_session_url
end
end
虽然每次我在地址栏输入 /user_sessions/destroy 时,都会收到以下错误:
Unknown action
The action 'show' could not be found for UserSessionsController
有谁知道如何解决这个问题?谢谢 :)