2

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 [email protected] 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.

4
  • probably belongs on server fault...
    – Jeffrey Kevin Pry
    Aug 1, 2011 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, 2011 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, 2011 at 1:28
  • 1
    This belongs on Stack Overflow!!
    – Vijay Dev
    Nov 9, 2011 at 9:04

1 Answer 1

4

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .