title: How to show twitter bootstrap modal via JS request in rails?
body: <p>I want to show a twitter bootstrap modal as a response to a JS request. My show.js.erb function looks something like this:</p>
  
  <pre><code>$(document).ready(function() {
  
      $('#dialog').modal('show')
  
  });
  </code></pre>
  
  <p>Here "dialog" is the modal's id. The modal code itself looks something like this:</p>
  
  <pre><code>&lt;div id="dialog" class="modal hide fade"&gt;
      &lt;div class="modal-header"&gt;
            &lt;a href="#" class="close"&gt;&amp;times;&lt;/a&gt;
            &lt;h3&gt; Showing Modal &lt;/h3&gt;
      &lt;/div&gt;
      &lt;div class="modal-body"&gt;
          I need to show up!
      &lt;/div&gt;
      &lt;div class="modal-footer"&gt;
          &lt;a href="#" class="btn primary"&gt;Done&lt;/a&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>One thing I am sure of is that the javascript is being called. I can have it alter items on the page. Another thing is that modal is working fine. It shows up just fine when I use an HTML button to trigger the request like this:</p>
  
  <pre><code>&lt;button data-controls-modal="dialog" data-backdrop="true" data-keyboard="true" class="btn danger"&gt; Show &lt;/button&gt;
  </code></pre>
  
  <p>Any idea why the modal doesn't show up on JS request? </p>
  
  <p>Thank You!</p>