我有一个名为list_controller的简单控制器,其索引基本上是
def index
@lists = List.all
end
然后我有一个名为index.html.haml的视图,它看起来像:
%h1 My lists
= @lists.each do |list|
.row-fluid
%h2= list.title
%p= list.description
%hr
= link_to "New list", new_list_url
这可以工作和渲染,但在我的列表的底部是列表对象的红宝石打印,在这种情况下是一个很大的丑陋:
[#<List id: 1, title: "Petes todo list", description: "This is petes main list, all sorts of good stuff", created_at: "2012-03-26 21:42:57", updated_at: "2012-03-26 21:42:57">, #<List id: 2, title: "Petes work list", description: "A list for petes work stuff", created_at: "2012-03-26 22:09:50", updated_at: "2012-03-26 22:09:50">]
为什么会这样?我怎么能阻止它?