everybody I\'m brand new with Ruby on Rails and I need to understand something. I have an instance variable (@users) and I need to loop over it inside an html.erb file a limitat
You could do
<% for i in 0..9 do %> <%= @users[i].name %> <% end %>
But if you need only 10 users in the view, then you can limit it in the controller itself
@users = User.limit(10)