Herb support documentation

Herb has been gaining a ton of traction & interest. It’s been a shot in the arm whenever I’ve been able to use it. I didn’t see any topics about Herb, so I figured it would be good to start one!

I don’t know if folks have experimented with Herb/ReActionView in Hanami apps. If you have, I’d love to hear about it!

I’d also love to hear about it!

What I do know is that Hanami View has its own ERB engine, specifically because none of the existing engines covered both of these features:

  • Auto-escaping any non-html_safe? values given to <%= ERB expression tags, with auto-escaping disabled when using the <%== alternative syntax.
  • Implicitly capturing and correctly outputting block content without the need for special helpers. This allows helpers like <%= form_for(:post) do %> to be used, with the form_for helper itself doing nothing more special than a yield.

You can read more in the PR introducing this engine.

If Herb::Engine can satisfy both of these (or can be enhanced to do so), then I’d love to not have to maintain our own ERB engine :slight_smile:

1 Like

When I wrote on Mastodon that I successfully added Herb checks to Emacs, I was actually using a Hanami project to test it. So for sure it worked, not so sure if in 100%, as I don’t have comparison.

I haven’t looked into ReActionView though. My understanding is that it’s built on top of ActionView, so not sure if applicable to Hanami.

1 Like