Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't log into Active Admin. Any way to create an admin user? [closed]

When I try to log in with the default admin user, I get "invalid email or password." Is there a way to create a user with code and try to log in that way?

I can log in on my live website, but not locally. My development code matches exactly what is on production.

like image 784
Dylan Richards Avatar asked Dec 07 '13 21:12

Dylan Richards


People also ask

How does active admin work?

Active Admin is a Ruby on Rails plugin for generating administration style interfaces. It abstracts common business application patterns to make it simple for developers to implement beautiful and elegant interfaces with very little effort.


2 Answers

another way is to place this file into db directory and then run

rake db:seed

or in console

Rails.application.load_seed 

there you can see how AdminUser is created, as well

like image 28
okliv Avatar answered Sep 25 '22 13:09

okliv


You can run a rails console on your development server, and create a new admin user in the console itself.

The following is a typical sequence of such commands (change them according to your setup):

user = AdminUser.new
user.email = "<your email>"
user.password = "<your password>"
user.save

That will create the required admin for you. :)

like image 178
Stoic Avatar answered Sep 25 '22 13:09

Stoic