String interpolation works only in double-quoted strings. You are attempting to use it in a single-quoted string. The fact that the single-quoted is nestled inside a double-quoted does not change this.
Thank you @slbaumgartner! I’m sure that was part of the problem but it also looks like the newline “\n” characters where causing an error! I was hoping to have nicely formatted code to work with on the html side. I’ll try some things but at least the data is getting across now. Thanks!
The benefit of #inspect is that it can be used with strings containing both single and double quotes. You don’t need to take the quotation style in the exact string into account.
… except that #inspectaddsunescaped double quotes around the argument string.
It only escapes the double quotes in the string that are preexsisting. So …