title: Rails jquery render bootstrap modal
body: <p>I'm trying to render a bottstrap modal view from a partial using a jquery.</p>
  
  <p>I have a controller <code>letters_controller.rb</code> with such code:</p>
  
  <pre><code>def new
    @letter = Letter.new
    respond_to do |format|
      format.html
      format.js
    end
  end
  </code></pre>
  
  <p>In <code>views/letters.slim</code> I have two files: <code>_new.slim</code>:</p>
  
  <pre><code>       .modal-header
           button.close type="button" data-dismiss="modal"
             i.fa.fa-times
         .modal-title
           h4 style='display: inline; margin-right: 15px' Write a letter
         .modal-body
           p lalallala
  
         .modal-footer
           button type="button" class="btn btn-default" data-dismiss="modal" Сlose
             .modal-dialog style='width: 700px'
               .modal-content
  </code></pre>
  
  <p>and <code>new.js.erb</code></p>
  
  <pre><code>$("#email-modal").html("&lt;%= escape_javascript(render 'letters/new') %&gt;");
  </code></pre>
  
  <p>In a calling view I has a button <code>= link_to new_letter_path, {:id =&gt; 'contact-us', :remote =&gt; true }</code></p>
  
  <p>Also in a calling view I has a <code>div</code> where modal should be rendered:
  <code>.modal.fade#email-modal role="dialog" tabindex="-1"</code></p>
  
  <p>The problem is that by clicking a button, anything's grayed out like it sould be, but no window appears. I checked a code and found out that jquery do not inserts <code>_new.slim</code>'s code into prepared <code>div</code>. What it could be about? Thanx!</p>
  
  <p>==================
  Logs for pressing a button (I left only those that are connected with that stuff):</p>
  
  <pre><code>I, [2016-10-18T22:31:11.380703 #1]  INFO -- : Started GET "/letters/new" for 172.18.0.4 at 2016-10-18 22:31:11 +0000
  I, [2016-10-18T22:31:11.404587 #1]  INFO -- : Processing by LettersController#new as JS
  D, [2016-10-18T22:31:11.411518 #1] DEBUG -- :   User Load (1.1ms)  SELECT  "users".* FROM "users" WHERE "users"...
  ....
  I, [2016-10-18T22:31:11.454585 #1]  INFO -- :   Rendered letters/_new.slim (0.1ms)
  I, [2016-10-18T22:31:11.459100 #1]  INFO -- :   Rendered letters/new.coffee within layouts/application (6.7ms)
  I, [2016-10-18T22:31:11.546124 #1]  INFO -- :   Rendered application/_support_email.slim (0.1ms)
  </code></pre>