The idea would be to replace ERB with templates that are pure XHTML and that the view would be pure code manipulating the template content.
Have this been done already ?
The idea would be to replace ERB with templates that are pure XHTML and that the view would be pure code manipulating the template content.
Have this been done already ?
I'm not sure if this is exactly what you mean, but mustache sounds similar:
http://github.com/defunkt/mustache http://www.rubyinside.com/mustache-for-logicfree-views-in-your-ruby-web-apps-2599.html
There used to be Lilu by Yuri Rashkovskii, but it is no longer maintained. It is still available, though, so if you're interested you can maintain it yourself. (It's very little code, actually, and the templating part proper doesn't need to change anyway. The only part that probably does need to change is the integration into the Rails view engine, and that should be fairly trivial, now that Rails 3 actually does have a proper view engine.)
A newer system that leverages HTML5's data-
attributes, is RuHL by Andrew Stone. Here's a quick taste (stolen from the website):
<!-- view.html -->
<html>
<body>
<p data-ruhl="say_hello"/>
</body>
</html>
# model.rb
def say_hello
"Hello World"
end
<!-- result.html -->
<html>
<body>
<p>Hello World</p>
</body>
</html>
Trellis is an attempt to create a component framework in Ruby. It's borrows more from Tapestry, but should have similarities to Wicket. http://www.trellisframework.org/