Active Storage
Usage
<script src='active-storage.js'></script>
<script>
var Post = Object.create( new ActiveStorage("Post") );
</script>
Link to the ActiveStorage Library and create a new model.
You now have access to your favorite ActiveRecord methods, powered by localStorage!
.new
var p = Post.new({name: "Jesse"});
.create
var p = Post.create({name: "Jesse"});
#save
p.save();
.find
Post.find( 1 );
.findBy
Post.findBy( {name: "Jesse"} );
.where
Post.where( {name: "Jesse"} );
.all
Post.all();
#destroy
p.destroy();
.destroyAll
Post.destroyAll();