Re:HTML_slice: Enable Ruby classes the ability to generate r...
by rootedbox on Thursday January 02, 2025 @12:24PM
(#42576412)
Yah I think html_slice would be ok in a ruby only project. But as the mantra goes if in rails do it the rails way. Helpers are great!
Re:HTML_slice: Enable Ruby classes the ability to generate r...
by doright on Thursday January 02, 2025 @01:48PM
(#42577392)
Nokogiri also has something similar; I've used it in a couple projects where I needed to output XML.
For example, this:
Could be written in a helper like this: