Mustache templates will be rendered using Ruby mustache on the server.
Add 'shared_mustache' to your your application's Gemfile.
By default when you run
rake shared_mustache:compile it will put the outputed
can be configured using an intializer. The
templates.js file should be kept
empty for development and only populated in production.
You should add the following lines to your
//= require shared_mustache //= require templates
This adds the jQuery helper for you to use the templates and in production will add the compiled templates.
At the bottom of your main layout you should add:
<%= render_mustache_templates if Rails.env.development? %>
rake shared_mustache:compile before the
assets:precompile step of your
Currently it expects your views to be found under
Create mustache templates as you would erb partials. So for example at
app/views/home/_row.mustache. You can then render it in an
<%= render_mustache('home/row', context) %>
It tries to use the same conventions as the native render methods. Such that you can ommit the controller if the mustache is in the same folder as the currently executing controller.