This gem needs a lot of work to be a stand-along thing, but provides some basic autosave functionality for activeadmin. It borrows extremely heavily from the fantastic paper_trail gem: https://github.com/airblade/paper_trail/. Originally this functionality was mixed into a custom branch of paper_trail but we opted to refactor it into a separate gem because it broke some of the basic conventions of paper_trail's data structure.
Add this line to your application's Gemfile:
gem 'autosaveable'
And then execute:
$ bundle
Or install it yourself as:
$ gem install autosaveable
- Create a "saves" table with "item_type:string", "item_id:integer", "whodunnit:string", "object:text"
- install this gem
- add has_autosave to your models
- add include AutoSaveable::ActiveAdmin to the corresponding activeadmin resources
- write javascript and a custom controller to autosave your forms... (see the ToDos)
- Add initializers/generators/whatever to create saves table
- Add tests
- Add javascript and controller code
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request