Hacker News new | ask | show | jobs
by ansman 5089 days ago
But on the other hand the view has to know about the template.

Change a tag name or class name (which I think is far more common than attribute names) would then break the relationship.

1 comments

This is true. However, the view already has to know about the template. The only difference is the how much it knows. It will add some extra responsibility if you change your classes a lot but I think I might prefer that over muddying the html with attributes and filters. Another thing that would be cool about a hash in the view is you could apply filters and presentation logic to the values there in a DRY way. Hope my tone doesn't come across as combative or dismissive. Thanks for taking the time to open source your code. I've just been thinking a lot about this recently.
Hehe, it's not actually my code, I just found this gem and I liked it :)