【发布时间】:2015-09-15 23:19:55
【问题描述】:
如何通过标记调用将自定义变量发送到部分。
<%= partial (:contentHeader, :title=>"Title Goes here") %>
/*trying to send a variable named title with "Title Goes Here" to the partial*/
部分是这样的:
<div class = "contentHeader">
<h2><%=title%></h2>
</div>
所以输出应该是
<div class = "contentHeader">
<h2>Title Goes Here</h2>
</div>
【问题讨论】:
标签: html ruby erb partials middleman