title: How to render different collections at the same place?
body: <p>Suppose, I have a model called Animal. This model contains enum attribute <strong>kind</strong> with two possible states.</p>
  
  <pre><code>class Animal &lt; ActiveRecord::Base
    enum kind: [ :cat, :dog ]
  end
  </code></pre>
  
  <p>Then in my controller I create corresponding instance variables collections.</p>
  
  <pre><code>class AnimalsController &lt; ApplicationController
    def index
      @cats = Animal.cat
      @dogs = Animal.dog
    end
  end
  </code></pre>
  
  <p>In my view I got two links and two collections.</p>
  
  <pre><code>&lt;h1&gt;Animals&lt;/h1&gt;
  
  &lt;b&gt;&lt;%= link_to 'List Cats' %&gt;&lt;/b&gt;
  &lt;b&gt;&lt;%= link_to 'List Dogs' %&gt;&lt;/b&gt;
  
  &lt;%= render partial: 'animals/cat', collection: @cats, as: :cat %&gt;
  &lt;%= render partial: 'animals/dog', collection: @dogs, as: :dog %&gt;
  </code></pre>
  
  <p>What is the prefered  way of displaying first collection instead of second or second one instead of the first in the same place depending on clicked link? How to do that?</p>