0
我有一个设置了索引页上常用文章和标签的博客。标签部分还显示在登录和注册页面上,看起来不太好。从视图中隐藏页面元素
这些标签是在_side.html.erb下的自己的专栏中设置的 - 有没有办法将它们从索引页面以外的所有其他页面中隐藏起来?
<h3>Blog Tags</h3>
<div id= "tags" >
<% cache('all_tags') do %>
<% for tag in Tag.find(:all, :order => 'name') %>
<ul style="list-style-type: none">
<li>
<%= link_to "#{tag.name}", tag_path(tag) %>
</li>
</ul>
<% end %>
</div>
这听起来像很多工作,我的应用程序几乎完成。有另一种方法来实现它吗?家里有种'隐藏'的方法? – ubique 2011-05-19 02:10:13
这实际上并没有太多的工作,只是复制你的布局,修改application.html.erb并将你的特定控制器指向具有* layout'new_layout'的新布局,:only =>:index * – moritz 2011-05-20 13:45:56
我看到了什么你意思是。谢谢 – ubique 2011-05-25 10:11:23