Hacker News new | ask | show | jobs
by swanson 2022 days ago
I share some of the same issues, I have found that ERB templates work better than HAML for lots of data attributes.

Basecamp seems to use liberal newlines / spacing when creating html tags (like one line per attribute) so that might help.

Server-side "component partials" still don't have a great story, but view_component is one emerging option.

2 comments

As another option, HAML lets you extract the attributes into a ruby helper method:

https://haml.info/docs/yardoc/file.REFERENCE.html#attribute-...

Same. I’ve been a happy user of Haml for about ten years, but I think that Tailwind and Stimulus will permanently force me back to ERB :(