Rails: Choosing an object on button click and showing info on modal
<p>I have a long list of cats in my database</p>

<pre><code>Cat(id: integer, name: string, gender: integer, home: boolean, created_at: datetime, updated_at: datetime)
</code></pre>

<p>and on my web page I wish to open a <a href="http://v4-alpha.getbootstrap.com/components/modal/" rel="nofollow">Bootstrap modal</a> with the information of only one cat in it. The id of the cat would be determined on button click. In my <code>CatsController</code> I have defined</p>

<pre><code>def index
 @cats = Cat.all
end
</code></pre>

<p>and the path <code>/cats/</code> shows</p>

<pre><code>&lt;button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#myModal"&gt; Open Modal &lt;/button&gt;

  &lt;div class="modal fade" id="myModal" role="dialog"&gt;
    &lt;div class="modal-dialog"&gt;
      &lt;!-- Modal content--&gt;
      &lt;div class="modal-content"&gt;
        &lt;div class="modal-header"&gt;
          &lt;button type="button" class="close" data-dismiss="modal"&gt;&amp;times;&lt;/button&gt;
          &lt;h4 class="modal-title"&gt;Modal Header&lt;/h4&gt;
        &lt;/div&gt;
        &lt;div class="modal-body"&gt;
          &lt;p&gt;Some text in the modal.&lt;/p&gt;
        &lt;/div&gt;
        &lt;div class="modal-footer"&gt;
          &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Close&lt;/button&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
</code></pre>

<p>How can this be done the Rails way?</p>