2010-01-13 22 views
0

我有一个名为常见一个div ID,我会喜欢的内容出现在这个div是在文件共享/ _common.html.erb在RoR中嵌入相同的评论页面?

我应该把什么代替<!-- content from _common.html.erb -->使共享的内容/_common.html.erb出现在div中?

<div id="common"> 
<!-- content from _common.html.erb --> 
</div> 

回答

3

这个替换您的HTML注释:

<%= render :partial => "share/common" %> 

,或者,如果你是on Rails的2.3.x版本:

<%= render "share/common" %>