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
Can't Get Paypal Encrypted Website Payments to Work in Rails
Inspect or Clean Up The Working Tree Error When Installing Ruby 2.1.3 on MAC Os X 10.9.5
How to Write (Large) Files with Ruby Eventmachine
Changing The Reading Order of Rubygem Sources
Generate Models from Existing Tables Using Rails 3
Using Rails Form Helpers with Serialized Custom Classes
Devise with Ruby on Rails - Force User to Change Password on First Login
Broken Rails Routes After Implementing Single Table Inheritance
Is It Still Advisable to Test Routes in Rails 4 with Minitest
How to Parse Days/Hours/Minutes/Seconds in Ruby
Problems While Making a Generic Model in Ruby on Rails 3
Explanation of Ruby Code for Building Trie Data Structures
Robust Way to Deploy a Rack Application (Sinatra)
Good Forms Helpers for Sinatra
Calling Module Method into Another Module in Ruby
In Ruby, How to Be Warned of Duplicate Keys in Hashes When Loading a Yaml Document