yield in ERB without rails

erb, ruby, ruby-on-rails

Solution

I don't think you can - Rails provides that infrastructure as part of actionpack.

What you may be able to do is take actionpack and add it into your script.

Alternatively you could roll a lightweight templating system yourself.

Alternatively alternatively use Rails or Merb or Sinatra.

Problem

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 with the application template does.

Original source