Personally I like to have little snippets like these as Slim/ERB templates and render them like partials (I have a utility class to actually do the rendering to avoid excess logging and make it easier to pass arguments and blocks to them.)
I just never liked "rendering" html elements directly in a ruby method. Feels weird, man.
I just never liked "rendering" html elements directly in a ruby method. Feels weird, man.