Q:

Eager load and list only specific Blogs Per User

A User has_many blogs, and a Blog belongs_to a user. I want to group the Blogs by User so that I can display/break down the blogs-per-user in the view.  
Here's the thing: I do not want to grab all of the blogs for all the users.  I DO want to grab all the users, but I only want to grab a couple of blogs.
If I did want to grab all of the blogs I could simply do this in the controller:
    @users = User.includes(:blogs).all #eager loads, grabs ALL of the associated blogs

And then in the view: to display them by user do this:
<% @users.each do |user| %>
  <h3><%= user.name + " (#{user.blogs.size} blogs)" %></h3>
  <% if user.blogs.any? %>
    <table>
      <thead>
        <th>Blog Title</th>
        <th>Created At</th>
      </thead>
      <tbody>
      <% user.blogs.each do |blog| %>
        <tr>
          <td> <%= link_to(blog, blog)%></td>
          <td> <%= blog.created_at.strftime("%m-%d-%Y")%></td>
        </tr>
      <% end %>
    </tbody>
  </table>
<% end %>

However, I do not want to eager load/grab/display all of the associated blogs per users.  I only want to grab blogs with ids = [1,2,3,4,5,6]
Assume that I have an array of the blog ids that I want to grab:
blog_ids = [1,2,3,4,5,6]

According to the rails guides for Eager Loading and Array conditions, I thought I could do something like this:
@all_users_and_only_desired_associated_blogs = User.includes(:blogs).where("blogs.id IN ?", blog_ids).references(:blogs)

Basically: I want to pretend that only the blogs with those ids exist: so eager load them and ignore any of the other blogs whenever I call user.blogs for a particular user. I think I am close with that query, but it is erroring out.  
The next step is to make sure that when I call user.blogs that it is not grabbing ALL of those users' associated blogs, but only those that were eager loaded from earlier.  
Ex in view:
<% @all_users_and_only_desired_associated_blogs.each do |user| %>
  <p> <%= user.name %> </p>
  <% user.blogs.each do |blog| %> #only the associated, eager loaded blogs, not ALL of the associated blogs
    <p>&nbsp;&nbsp;<%= blog.title%><p>
  <% end %>
<% end %>

A:

Thanks to Pavan's suggestion in the comments, here is what worked for me:
User.includes(:blogs).where("blogs.id IN (?)", blog_ids).references(:blogs)

