如何更改 ActiveAdmin 密码?
我使用 [email protected]//password 运行 ActiveAdmin,但我想要更改这些凭据。有人知道如何改变它们吗?
I got ActiveAdmin running with [email protected]//password, but I want to change these credentials. Anyone know how to change them?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
最好的方法是从 Rails 控制台更改它:
Best way to do this would be to change it from the rails console :
使用生成器安装 ActiveAdmin 时,您将在
db/migrate
文件夹中找到名为{timestamp}_devise_create_admin_users.rb
的迁移。找到此行并将其更改为您想要的任何内容:
但请记住,这只是种子密码,并且以明文形式公开。您可能想要做的是将 Devise 控制器设置为具有密码更改操作。查看 wiki 和 Railscast 寻求帮助。
When you install ActiveAdmin using the generator, you'll find a migration called
{timestamp}_devise_create_admin_users.rb
in yourdb/migrate
folder.Find and change this line to whatever you want:
Keep in mind though, that this is just the seed password, and is being exposed as plaintext. What you might want to do is set up the Devise controllers to have a password change action. Check out the wiki and the Railscast for help.
最终使用了 ActiveAdmin wiki 的答案:
https:/ /github.com/gregbell/active_admin/wiki/Your-First-Admin-Resource%3A-AdminUser
Ended up using an answer from the ActiveAdmin wiki:
https://github.com/gregbell/active_admin/wiki/Your-First-Admin-Resource%3A-AdminUser
将其添加到 app/admin/admin_users.rb 将启用编辑管理员用户的更改密码。
Add this at app/admin/admin_users.rb will enable change password for edit admin user.