【发布时间】:2012-09-15 14:03:26
【问题描述】:
我有一个观点
<%= render :partial => @list.items%>
显示这个命令叫做_item.html.erb。对吧?
<div class="well">
<%= image_tag item.photo.url(:small) %><br>
<b>Title</b> <%= item.title %><br />
<b>Description</b> <%= item.description %>
</div>
这很好用。
现在我有另一个名为_ilist.html.erb 的模板,我需要其中的一些数据。
我尝试通过添加模板选项来呈现它。但不会使用其他模板。第一个模板将随时调用。
<%= render :partial => @list.items, :template => 'items/ilist' %>
有没有调用其他_ilist-template的选项?
感谢您的帮助
【问题讨论】:
标签: ruby-on-rails templates rendering ruby-on-rails-3.2