You now have installed the batman-rails gem, setup a default directory structure for your frontend batman code. Then you generated the usual Rails server side scaffolding and finally generated Batman.js code to provide a simple single page app.

Precompiling Views

In production, you may want to send all your HTML templates with the first request rather than sending them as-needed. batman-rails includes a view helper to do this. Add it to your application layout:

<%= batman_define_views %>

It will gather HTML from app/assets/batman/html and interpolate them into JS code to preload Batman.View.store. If your HTML is in another directory, pass that directory as an option: