You're set up with batman-rails!

This page aims to be a collection of everything that batman.js is capable of. Over time it will grow to include more comprehensive examples, in addition to live applications using batman.js. But most of that isn't done yet. Hooray!

batman.js

Generate your resources

Everything in batman.js has a proper place, driven by batman.js's conventions. By default with batman-rails, your app lives in app/assets/batman. A great way to get started is using the automatic generators to add some of your resources.


More info on directory structure

Add your bindings

batman.js has a powerful system to automatically bind your HTML to data in your app and models. You can use data-* attributes to tell a node what type of stuff it cares about. Here's some simple examples.


More info on data bindings

Connect to Rails

batman-rails includes a StorageAdapter class that makes communicating with your Rails API extremely easy. First set the storageKey to tell it which API endpoint to use, then specify that the model should persist with the RailsStorage storage adapter.


More info on models