yield in ERB without rails

前端 未结 6 1753
轮回少年
轮回少年 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:29

    Check out Tilt (http://github.com/rtomayko/tilt/). It's the gem that handles templating in Sinatra and it provides ERB yields along with many other nice features.

提交回复
热议问题