Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/61.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 设计,什么是/我的用户/密码/编辑_Ruby On Rails_Devise - Fatal编程技术网

Ruby on rails 设计,什么是/我的用户/密码/编辑

Ruby on rails 设计,什么是/我的用户/密码/编辑,ruby-on-rails,devise,Ruby On Rails,Devise,我已经完成了一个非常基本的design设置design3.3.0,rails4.1.5,ruby 2.1.1。 我让它在emtpy应用程序中创建模型railsg designe:install和rails design my_user。 让我们看看我现在拥有的路线,为了更好地查看,我添加了空行: 1 new_my_user_session GET /my_users/sign_in(.:format) devise/sessions#new 2

我已经完成了一个非常基本的design设置design3.3.0,rails4.1.5,ruby 2.1.1。 我让它在emtpy应用程序中创建模型railsg designe:install和rails design my_user。 让我们看看我现在拥有的路线,为了更好地查看,我添加了空行:

1 new_my_user_session GET /my_users/sign_in(.:format) devise/sessions#new 2 my_user_session POST /my_users/sign_in(.:format) devise/sessions#create 3 destroy_my_user_session DELETE /my_users/sign_out(.:format) devise/sessions#destroy 4 my_user_password POST /my_users/password(.:format) devise/passwords#create 5 new_my_user_password GET /my_users/password/new(.:format) devise/passwords#new 6 edit_my_user_password GET /my_users/password/edit(.:format) devise/passwords#edit 7 PATCH /my_users/password(.:format) devise/passwords#update 8 PUT /my_users/password(.:format) devise/passwords#update 9 cancel_my_user_registration GET /my_users/cancel(.:format) devise/registrations#cancel 10 my_user_registration POST /my_users(.:format) devise/registrations#create 11 new_my_user_registration GET /my_users/sign_up(.:format) devise/registrations#new 12 edit_my_user_registration GET /my_users/edit(.:format) devise/registrations#edit 13 PATCH /my_users(.:format) devise/registrations#update 14 PUT /my_users(.:format) devise/registrations#update 15 DELETE /my_users(.:format) devise/registrations#destroy 现在让我们回顾一下:

我特别感兴趣的是理解6,7,8操作的含义,这些操作似乎可以编辑密码,但实际上却不能。事实上,还有两种方法可以做到这一点,即:

“忘记密码”功能操作4,5 “编辑用户”功能操作12、13、14 第二个问题是,取消注册操作的作用是什么

编辑1 此外,my_user/password/edit路由,不管它应该做什么,似乎都不起作用。当我浏览它时,我只是被重定向到根页面。 以下是日志:

Started GET "/my_users/password/edit" for 127.0.0.1 at 2014-09-22 16:37:04 +0200 Processing by Devise::PasswordsController#edit as HTML MyUser Load (0.7ms) SELECT "my_users".* FROM "my_users" WHERE "my_users"."id" = 5 ORDER BY "my_users"."id" ASC LIMIT 1 Redirected to http://localhost:3000/ Filter chain halted as :require_no_authentication rendered or redirected “忘记密码”功能操作4,5

这将为已注册的电子邮件生成新的重置密码令牌。这是忘记密码功能的一部分

“编辑用户”功能操作12、13、14

这也是忘记密码功能的一部分。这将发现用户在重置密码令牌的基础上进行编辑,然后更新密码

第二个问题是,取消注册操作的作用是什么

这将删除用户在注册期间插入的所有会话数据。喜欢清晰的功能。下面是设计注册取消操作中的注释。链接此处


你没有更改过密码吗?你知道,表单有三个字段:当前密码、新密码、新密码确认。我打赌6,7,8是这个的。也许我解释得不太清楚。没有人,但有两种其他方式来更改密码,您知道,表单有三个字段。。。行动12,13,14:-还有一个,那就是让你通过电子邮件做这件事对我来说足够公平了,我想这是这样的。。。问题是在这个非常重要的应用中。。。它不起作用。当您浏览root/my_users/password/edit时,在不注销和不编辑整个配置文件的情况下更改密码表单永远不会出现。您只需重定向到根目录。我知道这可能是一个全新的问题,但它是相关的,因为如果它起作用,我会很容易猜到它的作用。是的,如果你的所有其他部分,如忘记密码,都正常工作,那么它也应该起作用。为此,您应该查看日志,了解为什么它会将您重定向到root\u url。日志将为您提供更多有关这方面的信息。为什么它重定向。忘记密码在某种意义上可以显示我在开发中没有测试电子邮件的表单,但这不起作用:-让我看看logsok,我编辑了问题,添加了我在服务器上看到的development.log。我在阅读此链接后编辑了我的答案。我第一次是不对的。看看这个,希望它能100%的清除你的想法。对不起,我之前的回答错了。 Started GET "/my_users/password/edit" for 127.0.0.1 at 2014-09-22 16:37:04 +0200 Processing by Devise::PasswordsController#edit as HTML MyUser Load (0.7ms) SELECT "my_users".* FROM "my_users" WHERE "my_users"."id" = 5 ORDER BY "my_users"."id" ASC LIMIT 1 Redirected to http://localhost:3000/ Filter chain halted as :require_no_authentication rendered or redirected
# GET /resource/cancel
# Forces the session data which is usually expired after sign
# in to be expired now. This is useful if the user wants to
# cancel oauth signing in/up in the middle of the process,
# removing all OAuth session data.