Hacker News new | ask | show | jobs
by bretthopper 5279 days ago
The only way to stop putting too much logic in your views is to switch a logic-less templating system. I'm convinced that willpower, coding standards, code reviews, etc would never be enough to stop it.

Here's a decent implementation of mustache for Rails: https://github.com/goodmike/mustache_rails3

app/views becomes .rb files which act as a sort of presenters.

app/templates is where your actual mustache templates go.

There's a lot of benefits to this and a huge one is being able to reuse templates on the client-side.