Active Admin
Active Admin Documentation
Active Admin is a framework for creating administration style interfaces.
It abstracts common business application patterns to make it simple for
developers to implement beautiful and elegant interfaces with very little
effort.
An elegant DSL built for developer productivity.
Get started with one line of code or customize the entire interface with the provided DSL.# app/admin/posts.rb
ActiveAdmin.register Product do
# Create sections on the index screen
scope :all, :default => true
scope :available
scope :drafts
# Filterable attributes on the index screen
filter :title
filter :author, :as => :select, :collection => lambda{ Product.authors }
filter :price
filter :created_at
# Customize columns displayed on the index screen in the table
index do
column :title
column "Price", :sortable => :price do |product|
number_to_currency product.price
end
default_actions
end
end
Documentation & Support
-
Documentation & Guides: activeadmin.info/documentation.html
-
Wiki: github.com/gregbell/active_admin/wiki
-
RDoc: rubydoc.info/gems/activeadmin/frames
-
Live demo: demo.activeadmin.info/admin
- Website: www.activeadmin.info
- Need Support? Ask the Mailing list: groups.google.com/group/activeadmin
Getting Started
Active Admin is released as a Ruby Gem. The gem is to be installed within a Ruby on Rails 3 application. To install, simply add the following to your Gemfile:After updating your bundle, run the installergem 'activeadmin'
The installer creates an initializer used for configuring defaults used by Active Admin as well as a new folder at app/admin to put all your admin configurations.$ rails generate active_admin:install
Migrate your db and start the server:
Visit localhost:3000/admin and log in using:$ rake db:migrate
$ rails server
-
User: admin@example.com
-
Password: password
To register your first model, run:
This creates a file at app/admin/my_model_names.rb for configuring the resource. Refresh your web browser to see the interface.$ rails generate active_admin:resource [MyModelName]
Upgrading
When upgrading to a new version of ActiveAdmin you may need to run$ rails generate active_admin:assets
Next Steps
- The best place to get documentation is at activeadmin.info/documentation.html.
- To view a sample Active Admin application, checkout demo.activeadmin.info
- If you have any questions, please email the mailing list at groups.google.com/group/activeadmin
Tools Being Used
We believe strongly in not writing code unless we have to, so Active Admin is built using many other open source projects:InheritedResources | Inherited Resources speeds up development by making your controllers inherit all restful actions so you just have to focus on what is important. |
Formtastic | A DSL for semantically building amazing forms. |
Devise | User authentication is done using Devise |
Kaminari | Pagination for rails apps |
Iconic Icons | Excellent SVG icon set designed by P.J. Onori: somerandomdude.com/projects/iconic |
*This post source come from the active admin github.
Comments
Post a Comment