Most web applications have many more model objects exposed on the backend, or admin side, than they do on the front. Coding interfaces for all those models is redundant and a waste of resources when all you need is CRUD functionality that’s smart enough to handle all your ActiveRecord associations.
Enter the ActiveScaffold plugin. The successor to the popular AjaxScaffold project that amassed over 36,000 downloads, ActiveScaffold provides you with a wealth of dynamically created goodness:
- An AJAXified table interface for creating, updating, and deleting objects
- Automatic handling of ActiveRecord associations
- Sorting, Search and Pagination
- Graceful JavaScript degradation
- RESTful API support (XML/YAML/JSON) baked in
- Sexy CSS styling and theming support
- More extension points than you can shake a stick at
- Guaranteed to work on Firefox 1+, IE 6+ and Safari 2+
- Released under the MIT License, the same one as Rails itself, so you can use it freely in your commercial applications.
Getting Started (or read the full tutorial)
Install the latest version of the plugin for latest stable rails (2.3.x) (May require git to be installed):
script/plugin install git://github.com/activescaffold/active_scaffold.git
or keep the .git directory and switch to the “next” branch (cd vendor/plugins/active_scaffold && git checkout next) and get the latest updates as the core team submits them. However, the “next” branch can be highly unstable (perhaps not even fully tested) and is not recommended.
Add this to your layout:
<%= javascript_include_tag :defaults %>
<%= active_scaffold_includes %>
Add this to your controller:
active_scaffold :<your_model_name>
.. for example:
class UsersController < ApplicationController
active_scaffold :user
end
That’s it! Your first ActiveScaffold is up and running. But if you crave more, read on!
Further Reading
- Getting Started – goes a bit further than the examples on this page
- How to Approach ActiveScaffold – provides some perspective on how you can use ActiveScaffold: use cases, benefits and navigating the documentation.
Alternatives
We want you to find the best dynamic interface builder solution for your individual needs. Here are some other projects attacking similar problems that you might want to check out if ActiveScaffold isn’t what you’re looking for: