
Exposes database ORM to the Javascript side.
Ruby on Rails backend for the Databound javascript lib. Supports ActiveRecord and Mongoid
For more information go to javascript Databound repo.
Javascript library
Out of the box it does something like this.
User = new Databound('/users');
User.update({ id: 15, name: 'Saint John' }).then(function(updated_user) {
});
Installation
The library has two parts and has Lodash as a dependency.
I. Javascript part
Follow the guide on javascript Databound repo.
II. Ruby on Rails part
1. Add gem 'databound' to Gemfile.
2. Create a controller with method model which returns the model to be accessed.
Also include Databound
class UsersController < ApplicationController
include Databound
private
def model
User
end
end
3. Add a route to routes.rb
# This creates POST routes on /users to UsersController
# For where, create, update, destroy
databound :users
Additional features
All features are described in javascript Databound repo.