我有一个恼人的问题,我的视图一直在显示我的对象的属性数组!我的子菜单是假设以树状显示类别,它可以工作,但它也显示这个烦人的数组!如何阻止这些属性在我的视图中显示?
[< #Category ID:26,标题: “子测试”,描述: “测试,testception内的测试”,created_at: “2015年3月1日3点15分29秒”,的updated_at:“ 2015-03-03 01:08:09“,祖先:”6/24“>]
[<#分类标识:24,标题:”测试“,描述:”不要惊慌,这只是一个测试。“,created_at:”2015-03-01 02:06:35“,updated_at:”2015-03-03 01:07:52“,祖先:”6“>]
我明确不希望用户看到这一点。我如何摆脱它?
Show.html.erb视图:
<div id="submenu">
<%= render 'submenu_cats', categories: @category.root.children %>
</div>
_submenu猫部分:
<ul>
<%= categories.each do |category| %>
<li>
<%= link_to_unless_current category.title, category_path %>
<%= render 'submenu_cats', categories: category.children if category.children.present? %>
</li>
<% end %>
使用:4.2的Rails,红宝石2.1.5,祖先宝石
太棒了!答案很明显哈哈,谢谢! – nvrpicurnose 2015-03-03 01:36:57