title: Ruby on rails bootstrap modal window
body: <p>I have model Post.rb with title and description</p>
  
  <p>My index page.</p>
  
  <pre><code>Title 1
  Title 2
  Title 3
  </code></pre>
  
  <p>I need a description opened in bootstrap modal window in the same page</p>
  
  <p>index.html.erb</p>
  
  <pre><code>&lt;ul class="content"&gt;
    &lt;%= render @posts %&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>_post.html.erb</p>
  
  <pre><code>&lt;li&gt; 
    &lt;%= link_to post.title, '#myModal', 'data-toggle' =&gt; 'modal' %&gt;
  
    &lt;div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"&gt;
    &lt;div class="modal-dialog" role="document"&gt;
      &lt;div class="modal-content"&gt;
        &lt;div class="modal-header"&gt;
          &lt;h4 class="modal-title" id="myModalLabel"&gt;&lt;%= post.title %&gt;&lt;/h4&gt;
        &lt;/div&gt;
        &lt;div class="modal-body"&gt;
          &lt;%= post.description %&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;
  &lt;/li&gt;
  </code></pre>