0

If there is a _post.html.erb in app/views/posts/, I can input <%= render @posts %> in app/views/posts/index.html.erb , but if the _post.html.erb file in app/views/users/posts/, how to write?

I tried <%= render @posts, :template => 'users/posts/post' %> , but it does not work.

why
  • 23,923
  • 29
  • 97
  • 142

1 Answers1

1
<%= render :partial => 'users/posts/post', :collection => @posts %>
MrTheWalrus
  • 9,670
  • 2
  • 42
  • 66