Apologies if this has been asked before, I may have been searching for the wrong keywords.

I am trying to do an `.each` loop for all the rows of a database table named `users` for which `name` equals `user1`. How is that done?

My model **User** has a DB Table :users that contains these columns: `name | title | details | amount`

In my view I have this:

```
<div style="width:50%;float:left">
<h3>User1</h3>
<% @User1.each do |i| %>
  <p><%= i.title %></p>
  <p><%= i.details %></p>
  <p>$<%= i.amount %></p>
<% end %>
</div>

<div style="width:50%;float:left">
<h3>User2</h3>
  <% @User2.each do |i| %>
  <p><%= i.title %></p>
  <p><%= i.details %></p>
  <p>$<%= i.amount %></p>
<% end %>
</div>

```

For my controller I have this but it is giving an error:

```
@items = User.all
@User1 = @items.where(name: 'user1')
@User2 = @items.where(name: 'user2')

```

![enter image description here](https://i.stack.imgur.com/FdiuO.gif)