yield in ERB without rails

前端 未结 6 1745
轮回少年
轮回少年 2020-12-30 05:49

How can I use yield for template inheritance in erb? I want to use erb in a plain ruby CGI script and want to use a base template and subtemplate like it Rails wit

6条回答
  •  南笙
    南笙 (楼主)
    2020-12-30 06:16

    I wrote about adding this to the Standard Library's ERB here http://hostiledeveloper.com/2015/05/28/working-with-templates-in-ruby-erb.html

    It's surprisingly a pain in the butt.

提交回复
热议问题