Skip to content

Comment on ActiveRecord (and Rails) Considered Harmful

Comments

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.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.