Including one erb file into another

前端 未结 4 773
悲&欢浪女
悲&欢浪女 2020-12-08 07:41

I\'m writing a command-line tool that will ultimately output an HTML report. The tool is written in Ruby. (I am not using Rails). I\'m trying to keep the logic of the applic

4条回答
  •  感动是毒
    2020-12-08 07:50

    <%= ERB.new(sub_template_content).result(binding) %>
    

    does not work, when you are using erb cli utility, multiple _erbout variables are overriden and only last one is used.

    use it like this:

    <%= ERB.new(sub_template_content, eoutvar='_sub01').result(binding) %>
    

提交回复
热议问题