Can't Log into Active Admin. Any Way to Create an Admin User

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

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. :)

Cant login to Active Admin

Active Admin generally has another table for users known as admin_users. Please try the following in your console

user = AdminUser.create :email => 'user2@example.com', :password => 'please'

Can't create new user with ActiveAdmin

Forgot to add this little guy to the model...fml

after_create { |admin| admin.send_reset_password_instructions }

def password_required?
new_record? ? false : super
end

Can't log into Active Admin after pushing to Heroku

When you deploy to Heroku your code gets updated on your dynos. Your database doesn't. Migrations must be run, e.g. via heroku run rake db:migrate or a release phase command, and any data you want must be created.

Whatever users you've configured on your development machine won't exist on Heroku. This is a good thing.

You should be able to add the default admin user by running heroku run rake db:seed using the Heroku CLI tool. Alternatively, you could run heroku run rails c and create a user interactively.

ActiveAdmin 401 Unauthorized Can't Login using default or created users

This is about the most complete version of the problem and the solution that you're likely to find here.

The problem is that the user MUST exist in both Users and AdminUsers. I didn't have this problem when I setup ActiveAdmin the first time because there was simply a boolean in the guide I was using where you could check or uncheck if a user was an admin user or not. (It was more difficult to setup but a MUCH more sensible way of doing things.

Anyway you just need to go to a rails console and instead of this:

AdminUser.create :email => 'abc1@example.com', :password => 'password', :password_confirmation => 'password'

..do THIS:

User.create :email => 'abc1@example.com', :password => 'password', :password_confirmation => 'password'

Adding New Admins to Active Admin

What brian said works perfectly
http://net.tutsplus.com/tutorials/ruby/create-beautiful-administration-interfaces-with-active-admin/

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

Cannot create a new user using ActiveAdmin with Rails 4

add to your model:

def email_required?
false
end

def email_changed?
false
end


Related Topics



Leave a reply



Submit