Search code examples
rubytemplatesframeworksmustache

Are there any Ruby MVC web frameworks with great support for logic-less templates?


I've been on the hunt for a Ruby MVC web framework with support for logic-less templates (i.e. Mustache) for a while now. I'm looking for this:

  1. Support for routing paths and HTTP methods
  2. Concept of controllers and helpers similar to how Rails works
  3. Separate (from the controllers) views with logic-less templates

In my search I've touched Rails, Sinatra and Ramaze, but they all fail on some aspect of what I'm looking for; all attempts I've seen of integrating Mustache into Rails have been half-baked; Sinatra doesn't give me the concept of controllers (and Mustache::Sinatra makes strange assumptions of namespaces and instantiates views twice unnecessarily sometimes); and Ramaze fails to give me a straight-forward way to bind paths and HTTP methods to actions. Of these three I liked Ramaze the most, but the routing issues are a showstopper to me.

I'm open to solutions in any somewhat stable framework, including the mentioned ones if I've missed something there. Also, alternatives to Mustache are fine even though I prefer it to other logic-less template languages due to its easy syntax and many implementations in different languages (using the same templates for dynamic views in the browser is one of my goals).


Solution

  • You might want to look at Padrino, it's based on Sinatra, but is more of a MVC framework than Sinatra is out of the box.