shellz wrote in post #1095771:
syntax error, unexpected tSTRING_BEG, expecting
which refers to a line in a .js.erb file ending in -%>.
The ending hyphen was added to eliminate the line break in .html.erb
But when I remove the hyphen, the error goes away. The last sentence
CSS and ERB' in
says 'Note that the closing tag cannot be of the style -%>.' Does anyone
know why adding the dash before %> in .js.erb (and apparently in
files causes the rails precompiler to fail?
Because using -%> causes a syntax error, unexpected tSTRING_BEG to
<<<Damn that was a smart-ass reply. Shame on me>>>
In my quick test case I got a syntax error, unexpected ')'
...rbout.concat(( 'Hello World' -).to_s); _erbout.concat "\");\...
Notice that the dash is still there trying to be concatenated in.
I don't really know exactly why, but it's obvious you cannot use -%> in
js.erb or css.erb, so don't do it and your code wont fail.