Upload
smartlogic
View
1.454
Download
2
Tags:
Embed Size (px)
DESCRIPTION
Software developer Nestor Walker walks us through creating admin interfaces the easy way.
Citation preview
Active AdminCreate your admin interface the easy way
Nestor Walker
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 [email protected] / password
● You now have an admin interface.
ModelsActive admin will set up your models with the following generator:
This creates a file in app/admin/my_model_name.rb
Models
● Index ColumnsBy default Active Admin will create a table view of the model with a column
for each field. This can also be customized.
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 the models fields using the appropriate selection type.
Models
Active Admin uses Formtastic to give you complete control over your data entry.
Forms
FormsThe form can also be put into a partial.
app/views/admin/users/_form.html.erb
FormsWith the partial:
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