How to create an initial user in ActiveAdmin
Method 1
As ActiveAdmin prepares seed file
$ rake db:seed
.
In this case, the following data is probably created.
email: admin@example.com password: password
(See db / seeds.rb for details)
Method 2
May be created directly with pry (the Rails console).
Move to a project
cd /path/to/project
Launch the Rails console.
$ bundle exec rails console
Execute ActiveAdmin's user creation method.
pry(main)> AdminUser.create!(:email => 'admin@example.com', :password => 'password')
The entered password is encrypted and a user is created.
version
- ActiveAdmin 4.2.4
Supplement
Based on creating Rails administration screen in ActiveAdmin .
The above page passes the parameter password_confirmation, which was not necessary in my environment. It works just by specifying email and password.
Original by
About
チャットメンバー募集
何か質問、悩み事、相談などあればLINEオープンチャットもご利用ください。
公開日時
2019-04-16
Discussion