First of all, is this a good place to report Erubis bugs? Their GitHub repo is stale (no action since 2011) and I was suggested by the Rails team to try here.
It seems that ERB (Erubis) doesn't handle well tags embedded within another tag. My goal is to produce ERB code with some values prefilled in the first pass.
Status changed from Rejected to Third Party's Issue
ERB (Erubis)
ERB and Erubis are totally different things.
$irb-rerb-rerubis-rerubiirb(main):001:0>RUBY_VERSION=>"2.5.0"irb(main):002:0>erb="<div><%%= Results: <%= 'first' %> | <%= 'second' %> | <%= 'third' %> %></div>"=>"<div><%%= Results: <%= 'first' %> | <%= 'second' %> | <%= 'third' %> %></div>"irb(main):003:0>ERB.new(erb).result=>"<div><%= Results: first | second | third %></div>"irb(main):004:0>Erubis::Eruby.new(erb).result=>"<div><%= Results: <%= 'first' %> | second | third %></div>"irb(main):005:0>evalErubi::Engine.new(erb).src=>"<div><%= Results: <%= 'first' %> | second | third %></div>"
As you can see, ERB (which is included in Ruby core) is working as expected, and Erubis (used in older Rails) and Erubi (used in recent Rails) are not.