title: How to open a bootstrap modal from link_to content?
body: <p>I'm creating a reddit clone, and clicking the login or signup text on the header opens a modal for the user to enter their credentials.</p>
  
  <p>I created a modal partial here:</p>
  
  <pre><code>&lt;div class="modal fade" id="popUpWindow"&gt;
      &lt;div class="modal-dialog"&gt;
          &lt;div class="modal-content"&gt;
              &lt;div class="col-md-6"&gt;
                  &lt;!-- header --&gt;
                  &lt;div class="modal-header"&gt;
                      &lt;button type ="button" class="close" data-dismiss="modal"&gt;&amp;times;&lt;/button&gt;
                      &lt;h3 class="modal-title"&gt;CREATE A NEW ACCOUNT&lt;/h3&gt;
                  &lt;/div&gt;
                  &lt;!-- body (form) --&gt;
                  &lt;div class="modal-body"&gt;
                      &lt;form role="form"&gt;
                          &lt;div class="form-group"&gt;
                              &lt;input type ="username" class="form-control" placeholder="choose a username"&gt;
                          &lt;/div&gt;
                          &lt;div class="form-group"&gt;
                              &lt;input type ="password" class="form-control" placeholder="password"&gt;
                          &lt;/div&gt;
                          &lt;div class="form-group"&gt;
                              &lt;input type ="password_confirmation" class="form-control" placeholder="verify password"&gt;
                          &lt;/div&gt;
                          &lt;div class="form-group"&gt;
                              &lt;input type ="email" class="form-control" placeholder="email"&gt;
                          &lt;/div&gt;
                      &lt;/form&gt;
                  &lt;/div&gt;
                  &lt;!-- button --&gt;
                  &lt;div class="modal-footer"&gt;
                      &lt;button class="btn btn-primary btn-block"&gt;SIGN UP&lt;/button&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
  
              &lt;div class="col-md-6"&gt;
                  &lt;!-- header --&gt;
                  &lt;div class="modal-header"&gt;
                      &lt;button type ="button" class="close" data-dismiss="modal"&gt;&amp;times;&lt;/button&gt;
                      &lt;h3 class="modal-title"&gt;LOG IN&lt;/h3&gt;
                  &lt;/div&gt;
                  &lt;!-- body (form) --&gt;
                  &lt;div class="modal-body"&gt;
                      &lt;form role="form"&gt;
                          &lt;div class="form-group"&gt;
                              &lt;input type ="username" class="form-control" placeholder="username"&gt;
                          &lt;/div&gt;
                          &lt;div class="form-group"&gt;
                              &lt;input type ="password" class="form-control" placeholder="password"&gt;
                          &lt;/div&gt;
                      &lt;/form&gt;
                  &lt;/div&gt;
                  &lt;!-- button --&gt;
                  &lt;div class="modal-footer"&gt;
                      &lt;button class="btn btn-primary btn-block"&gt;LOG IN&lt;/button&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
  
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Now I'm trying to access this modal code from the header partial here:</p>
  
  <pre><code>&lt;header class="navbar navbar-fixed-top navbar-inverse"&gt;
      &lt;div class="container"&gt;
      &lt;%= link_to "reddit", root_path , :id =&gt; 'logo' %&gt;
          &lt;nav&gt;
              &lt;ul class="nav navbar-nav navbar-right"&gt;
                  &lt;li&gt;
                  &lt;%= link_to 'Sign up or log in', "#", data: {toggle: "popUp", target: "#popUpWindow"} %&gt;
                  &lt;/li&gt;
              &lt;/ul&gt;s
          &lt;/nav&gt;
      &lt;/div&gt;
  &lt;/header&gt;
  </code></pre>
  
  <p>I thought this line would successfully open the modal by its id popUpWindow: <code>&lt;%= link_to 'Sign up or log in', "#", data: {toggle: "popUp", target: "#popUpWindow"} %&gt;</code></p>
  
  <p>There are no errors appearing, but clicking the link_to content does not trigger anything to open. </p>
  
  <p>In application.js I have:</p>
  
  <p><code>//= require jquery</code></p>
  
  <p><code>//= require bootstrap</code></p>