21

I got ActiveAdmin running with admin@example.com//password, but I want to change these credentials. Anyone know how to change them?

kidcapital
  • 5,064
  • 9
  • 46
  • 68

4 Answers4

39

Best way to do this would be to change it from the rails console :

    admin = AdminUser.find_by_email("admin@domain.com")
    admin.password = "newPassword"
    admin.save
bpn
  • 3,082
  • 2
  • 19
  • 22
11

When you install ActiveAdmin using the generator, you'll find a migration called {timestamp}_devise_create_admin_users.rb in your db/migrate folder.

Find and change this line to whatever you want:

AdminUser.create!(:email => 'admin@example.com', :password => 'password', :password_confirmation => 'password')

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.

Sudhir Jonathan
  • 16,998
  • 13
  • 66
  • 90
0

Add this at app/admin/admin_users.rb will enable change password for edit admin user.

ActiveAdmin.register AdminUser do
  index do
    column :email
    column :current_sign_in_at
    column :last_sign_in_at
    column :sign_in_count
    default_actions
  end

  form do |f|
    f.inputs "Admin Details" do
      f.input :email
      f.input :password
    end
    f.buttons
  end  
end
TonyTakeshi
  • 5,869
  • 10
  • 51
  • 72
0

Ended up using an answer from the ActiveAdmin wiki:

https://github.com/gregbell/active_admin/wiki/Your-First-Admin-Resource%3A-AdminUser

kidcapital
  • 5,064
  • 9
  • 46
  • 68