I have the following simple problem with rails.
Let say I have a model User.
In a view, if I do:
<%= render User.all %>
The file view in views/user/_user.html.erb will be called and printed for each of the users.
How can I change this to use an specific view?
I need something like:
<%= render :data=>User.all :template=>"user/_user_2ndview.html"%>
Any help?
Thanks in advance
You can use the
collectionoption:The view must be placed in views/users/_user2ndview
See the Rails guides on rendering collections for more details.