我正在使用 gem clear 进行用户身份验证,但现在我在实现“更改密码”链接时遇到了问题。这就是我所拥有的:
<a href="<%= edit_user_password_path(current_user) %>">...</a>
但Clearance::passwords_controller
我们有以下内容:
before_filter :forbid_missing_token, only: [:edit, :update]
...
def forbid_missing_token
if params[:token].to_s.blank?
flash_failure_when_forbidden
render template: 'passwords/new'
end
end
所以它呈现一个new
模板而不是edit
. 这是:token
为了什么?我怎样才能将它传递给控制器?我在哪里可以得到它?