Admin section is a common module for most of the applications. For Rails applications we have a gem called Active Admin. That can be used to create application from scratch to admin interfaces with little effort.
Its a framework where all the admin tasks can be managed. It creates the beautiful admin interface that gives you access to manage the data and it can be customized easily.
How to install and setup?
First I will be creating three modules for my Rails 5 application.
Artist, Producer and Movie
Lets add activeadmin to the gemfile and do bundle install.
There are some dependencies you need to add for Rails 5. Add below gem to the gemfile and do bundle install again.
Run the generator to install active admin. It creates all the administrative files under app/admin directory. Device gem used by active admin for authentication.
Your terminal prompts you some settings need to be configured manually once you ran above command.
Requires two settings to authenticate and use current user in the application.
To force controller methods to authenticate
To access current user from the methods
Both above settings can be set to false to turn off authentication.
Start the rails server and navigate to the http://localhost:3000/admin. You can login by using following credentials.
The admin dashboard will be displayed once you login successfully. Top menu is showing the list of models registered with active admin. As of now we have only one model AdminUser. Here you can create or edit admin information.
Here we need to register our models with active admin.
Before that lets add some data to your db.
Know More About Active Admin and its Customization from here: http://www.railscarm...s/active-admin/