我正在为我的用户使用Devise。我想在发送邮件以更改密码后更改重定向。所以我创建了一个个人控制器users / passwords_controller
class Users::PasswordsController < Devise::PasswordsController
def new
super
end
# POST /resource/password
def create
self.resource = resource_class.send_reset_password_instructions(resource_params)
if successfully_sent?(resource)
respond_with({}, :location => after_sending_reset_password_instructions_path_for(resource_name))
else
respond_with(resource)
end
end
def edit
super
end
def update
super
end
protected
def after_sending_reset_password_instructions_path_for(resource_name)
root_url
end
def assert_reset_token_passed
if params[:reset_password_token].blank?
set_flash_message(:error, :no_token)
redirect_to root_url
end
end
end
问题是控制器不再知道'resource_params'(在'create'的第一行)。
我真的不知道如何解决。我应该把资源放在哪里?