Skip to content

Instantly share code, notes, and snippets.

@plexus
Last active December 20, 2015 22:39
Show Gist options
  • Save plexus/6206294 to your computer and use it in GitHub Desktop.
Save plexus/6206294 to your computer and use it in GitHub Desktop.

Currently pretty much all Rails helpers call tag or content_tag internally to generate tags.

To integrate Hexp with Rails it's possible to override those two methods, and now helpers return syntax tree objects rather than strings.

The main exception are helpers that generate several tags and then join the result.

What I would love to see (I'd happily make a PR) is that helpers use an internal method (e.g. join_tags) that just delegates to Array#join, but that one can override like tag and content_tag.

@plexus
Copy link
Author

plexus commented Aug 11, 2013

I admit it's a niche use case, but it would be a relatively small, backwards compatible change. And it would make an hexp-rails gem a lot more straightforward. Right now I need to duplicate all helpers that call join, whereas the other just work "out of the box"

@PragTob
Copy link

PragTob commented Aug 11, 2013

? Why is this a gist not an issue on rails/rails?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment