Skip to content

Commit

Permalink
Merge pull request activeadmin#1417 from cwoodcox/master
Browse files Browse the repository at this point in the history
add a default admin dashboard for generated admin users
  • Loading branch information
gregbell committed Jul 5, 2012
2 parents 4bf9ac4 + 155c17a commit 69a29f8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/generators/active_admin/install/install_generator.rb
Expand Up @@ -20,6 +20,10 @@ def copy_initializer
def setup_directory
empty_directory "app/admin"
template 'dashboard.rb', 'app/admin/dashboard.rb'
if options[:users].present?
@user_class = name
template 'admin_user.rb.erb', "app/admin/#{name.underscore}.rb"
end
end

def setup_routes
Expand Down
20 changes: 20 additions & 0 deletions lib/generators/active_admin/install/templates/admin_user.rb.erb
@@ -0,0 +1,20 @@
ActiveAdmin.register <%= @user_class %> do
index do
column :email
column :current_sign_in_at
column :last_sign_in_at
column :sign_in_count
default_actions
end

filter :email

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

0 comments on commit 69a29f8

Please sign in to comment.