To iterate over an array of users matching those in a given list, use
in your controller:
@users = User.where(name: list_of_names)
where list_of_names
is an array of strings,
and, in your view:
<% @users.each_with_index do |user, idx| %>
<div id="user-<%= idx %>">
<%= user.name %>
<%= user.details %>
# etc
</div>
<% end %>
and etc.
See the Rails guides for more.