Active Admin: Create Your Admin Interface the Easy Way

1,950 views
1,751 views

Published on

Software developer Nestor Walker walks us through creating admin interfaces the easy way.

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,950
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
19
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Active Admin: Create Your Admin Interface the Easy Way

  1. 1. Active AdminCreate your admin interface the easy wayNestor Walker
  2. 2. Install● Add to your Gemfile:● For Rails >= 3.1 Active Admin is also dependant on sass-rails and a beta version of meta_search:● After updating the Bundle, run the active admin install generator.● Migrate your db and start the server● Now visit http://localhost:3000/admin● Log in with admin@example.com / password● You now have an admin interface.
  3. 3. ModelsActive admin will set up your models with the following generator:This creates a file in app/admin/my_model_name.rb
  4. 4. Models● Index Columns By default Active Admin will create a table view of the model with a columnfor each field. This can also be customized.
  5. 5. Models● Filters Active Admin out of the box has the ability to filter by string, date_range,numeric, select, and check_boxes. By default it will create filters with all themodels fields using the appropriate selection type.
  6. 6. Models
  7. 7. FormsActive Admin uses Formtastic to give you complete control over your dataentry.
  8. 8. FormsThe form can also be put into a partial.app/views/admin/users/_form.html.erb
  9. 9. Forms With the partial:
  10. 10. DashboardThe dashboard can be customized in a way similar to the index pages.A partial can also be used inside a section with:render new_users # => this will render/app/views/admin/dashboard/_new_users.html.erb

×