问题描述
我正在为我的用户使用devise。我最近安装了导轨,一切工作都很精美。但是我不知道如何添加一个新的管理员用户。我可以看到活动管理员在数据库中创建了一个 admin_user
表,其中包含用户[email protected],用于登录界面。
我尝试添加 admin_user
作为资源,以便我可以点击活动管理界面中的添加管理员用户按钮添加新的用户,但这似乎不起作用。
什么布赖恩说完美的工作
AdminUser.create!(:email =>'admin @ example。 com',:password =>'password',:password_confirmation =>'password')
I am using devise for my users. I recently installed the rails Active Admin gem, everything is working beautifully.
However I can't figure out how to add a new admin users. I can see that active admin created an admin_user
table in the db with a user [email protected], which I use to log in to the interface.
I tried adding admin_user
as a resource so that I can just click the Add Admin User button within the active admin interface to add a new user, however that does not seem to work.
What brian said works perfectlyhttp://net.tutsplus.com/tutorials/ruby/create-beautiful-administration-interfaces-with-active-admin/
AdminUser.create!(:email => '[email protected]', :password => 'password', :password_confirmation => 'password')
这篇关于将新的管理员添加到活动管理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!