2012-06-06 69 views
0

如果app/views/posts /中有一個_post.html.erb,我可以在app/views/posts/index.html.erb中輸入<%= render @posts %>,但是如果app/views /用戶/帖子/,如何寫?我試過<%= render @posts, :template => 'users/posts/post' %>,但它不起作用。如何使用rails3中的模板呈現集合?

回答

1
<%= render :partial => 'users/posts/post', :collection => @posts %>