Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Add rails support
* Templates go in app/templates/{controller}/{action}.{mime}.mustache * Mustaches (ie, the ruby classes) go under app/views/{controller}/{action}.rb and should inherit from Mustache::Rails * Controller ivars will be copied to your mustache class. * You can omit declaring the Mustache. In that case, an instance of Mustache::Rails will be used for evaluation. If this is the case, then attr_readers will be defined for your controller ivars, since you can't access them directly from the template. * Mustache::Rails also delegates any methods to the ActionView::Base instance used by rails, so helpers should work fine. * You can't use Mustache's {{< partial }} syntax. Yet. * There's no way to use the form helpers from rails in a mustache template, but alternate solutions like Bureaeucrat (http://github.com/tizoc/bureaucrat) which ports django's form objects into ruby might be useful. * Templates can go in app/views/{controller}/{action}.{mime}.mustache still, if you prefer to keep them alongside your views. Mustache will just look for them in app/templates before.
- Loading branch information