🖥

How to create an initial user in ActiveAdmin

2019/04/16に公開

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

ActiveAdmin で初期ユーザーを作成する方法

About

About this translattion

チャットメンバー募集

何か質問、悩み事、相談などあればLINEオープンチャットもご利用ください。

https://line.me/ti/g2/eEPltQ6Tzh3pYAZV8JXKZqc7PJ6L0rpm573dcQ

Twitter

https://twitter.com/YumaInaura

公開日時

2019-04-16

Discussion