In a plain-text .erb template, what method would you suggest I use to produce the most maintainable/readable code for something like this:
ITEM DESCRIPTION QTY PRICE
Product Name One 1 $10.00
Another Product With a Longer Name 2 $5.00
Yet Another Item 1 $30.00
Where each of those rows is (obviously) variable, based on the items that have been purchased.
I could calculate the needed whitespace in a helper method, but is this already a solved problem with a more elegant solution?
Sounds like you need a plain text table generator. The only one I can think of for ruby is this: https://github.com/visionmedia/terminal-table but there may be others if this one doesn’t fit your needs.