The inject_erb plugin allows you to inject content directly into the template output:
<% inject_erb("Some HTML Here") %>
This will inject Some HTML Here
into the template output, even though the tag being used is <%
and not <%=
.
This method can be used inside methods, such as to wrap calls to methods that accept template blocks, to inject code before and after the template blocks.
Classes and Modules
Public Class methods
load_dependencies(app)
[show source]
# File lib/roda/plugins/inject_erb.rb 18 def self.load_dependencies(app) 19 app.plugin :render 20 end