What is ActiveAdmin?
Active Admin is a Ruby on Rails plugin for generating administration sytle interfaces. The goals of this plugin are easy-to-use for non-techical users and fast for developers.
How To Use ActiveAdmin
Suppose we are create Blog web application.
Add the following line to your Gemfile.
Run bundle install.
After installation is finished, it will create:
- An configuration file on config/initializers/active_admin.rb
- AdminUser model on app/models/admin_user.rb
- An directory called app/admin to configure the admin interface of our resource.
- Migration files.
Migrate your db and start the server.
http://localhost:3000/admin and log in using:
- Email: email@example.com
- Password: password
Next, for integration with our model, let’s create
Create admin interface for
Post model. Because we use ActiveAdmin, we don’t need to create controller for
Post model. This generator will create file on
Above command creates a file at
app/admin/posts.rb for configuring the resource.
http://localhost:3000/admin/posts to see the result.
More information about ActiveAdmin
- Register to Digital Ocean cloud with this link, you will get $50 credit
- Premium PSD an website / Wordpress
- Easy and cheap CDN in the world