Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am new to Ruby on Rails. I am using ActiveAdmin for administration purposes.

I have Googled a lot about "how to manage admin users" for example, changing default username password from admin@example.com and password to something else. Or how to add additional admin users and giving them specific rights to specific admin users.

I would really appreciate any help/tips you can provide that can get me started.

share|improve this question

migrated from stackoverflow.com Aug 1 '11 at 14:10

This question came from our site for professional and enthusiast programmers.

    
probably belongs on server fault... –  Jeffrey Kevin Pry Aug 1 '11 at 14:03
    
have you completely read the documentation ? May be user was addable here demo.activeadmin.info/admin/customers or eq in your app –  Awea Aug 1 '11 at 14:08
    
@Awea: I did read full documentation. I didn't find anything that touches on how to manage admin users. –  Moon Aug 2 '11 at 1:28
1  
This belongs on Stack Overflow!! –  Vijay Dev Nov 9 '11 at 9:04
add comment

1 Answer

up vote 4 down vote accepted

You just have to register AdminUser as a manageable resource:

$> rails generate active_admin:resource AdminUser

Then, just customize the whole thing but remember that both 'password' and 'password_confirmation' field have to be present in the form if you want to be able to manipulate passwords - you decide if that's a good idea. I did it like this but you're more than welcome to do anything you please:

ActiveAdmin.register AdminUser do

  filter :email

  index do
    id_column
    column :email
    column :last_sign_in_at
    column :created_at
    default_actions
  end

  show :title => :email do
    panel 'Admin Details' do
      attributes_table_for admin_user, :email, 
                                       :last_sign_in_at, 
                                       :last_sign_in_ip,
                                       :created_at, 
                                       :sign_in_count
    end
    active_admin_comments
  end

  form do |f|
    f.inputs 'Details' do
      f.input :email
      f.input :password
      f.input :password_confirmation
    end
    f.buttons
  end

end

If you need inspiration, look at the demo app provided by gregbell on GitHub.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.