title: How do I force the fresh render of a modal?
body: <p>I have a modal that is generated on the first page load, but because this modal is rendered for each <code>node</code> on the page, it always has the wrong <code>node</code> value because the modal is always stale. i.e. if the rendered HTML has <code>node.id=7</code> on completed page load, it will always work on <code>node.id=7</code> even if you want it to render for <code>node.id=6</code>.</p>
  
  <p>This is my modal:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;div class="modal tagging fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"&gt;
    &lt;div class="modal-dialog"&gt;
      &lt;div class="modal-content"&gt;
        &lt;div class="modal-header"&gt;
          &lt;button type="button" class="close" data-dismiss="modal" aria-label="Close"&gt;&lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;
          &lt;/button&gt;
          &lt;h4 class="modal-title" id="myModalLabel"&gt;Tag User&lt;/h4&gt;
        &lt;/div&gt;
        &lt;div class="modal-body"&gt;
          &lt;%=s imple_form_for node, url: add_tagged_user_node_path(node), method: :post do |f| %&gt;
            &lt;%=f .error_notification %&gt;
  
              &lt;div class="form-inputs"&gt;
                &lt;%=f .association :user, label: "Users", collection: @users, as: :check_boxes, checked: node.user_tags %&gt;
              &lt;/div&gt;
  
              &lt;div class="form-actions"&gt;
                &lt;%=f .button :submit %&gt;
              &lt;/div&gt;
              &lt;% end %&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>This is the trigger for that modal:</p>
  
  <pre><code>  &lt;a class="plus" href="javascript:;" data-toggle="modal" data-target="#myModal"&gt;&amp;nbsp;&lt;/a&gt;
  </code></pre>
  
  <p>What I would like to do is whenever the trigger is pressed, it basically performs a fresh page request for that modal - which would then populate the modal with the correct <code>node.id</code>.</p>
  
  <p>How do I force that refresh when the button is pressed?</p>
  
  <p><strong>Edit 1</strong></p>
  
  <p>Here is the entire <code>index.html.erb</code> that the partials are called from:</p>
  
  <pre><code>      &lt;% @nodes.each do |node| %&gt;
              &lt;!-- Upload Video Comment Popup --&gt;
              &lt;%= render partial: "shared/upload", locals: {node: node} %&gt;
  
        &lt;div class="box"&gt;
            &lt;%= render partial: "nodes/box", locals: {node: node} %&gt;
            &lt;%= render partial: "nodes/comments", locals: {node: node} %&gt;                         
        &lt;/div&gt;
        &lt;% end %&gt; &lt;!-- node --&gt;
  </code></pre>
  
  <p>Here is the <code>nodes/box</code> partial, which contains the call we are interested in:</p>
  
  <pre><code>&lt;!-- Author --&gt;
                &lt;div class="author clearfix"&gt;
                    &lt;a class="avatar" href="#"&gt;
                      &lt;%= image_tag node.user.avatar.url, size: "48x48", :class =&gt; "header img-circle" %&gt;
                    &lt;/a&gt;
                    &lt;h5 class="name"&gt;&lt;%= node.user.name %&gt;&lt;/h5&gt;
                    &lt;p class="date"&gt;&lt;%= node.created_at.strftime("%Y/%m/%d") %&gt;
                                          &lt;span class="video-title-controls"&gt;&lt;a href="#"&gt;&lt;i class='fa fa-trash-o fa-lg pull-right'&gt;&lt;/i&gt;&lt;/a&gt;&lt;/span&gt;
                                      &lt;/p&gt;
                &lt;/div&gt;
                &lt;!-- Video --&gt;
                &lt;div class="video clearfix"&gt;
                    &lt;% if node.is_video? %&gt;
                        &lt;%= raw yt_client.my_video(node.media.yt_video_id).embed_html5({:width =&gt; '280', :height =&gt; '300'}) %&gt;
                    &lt;% end %&gt;
                &lt;/div&gt;
                &lt;!-- Titles --&gt;
                &lt;div class="titles clearfix"&gt;
                                  &lt;% if can? :manage, node %&gt;
                    &lt;h5&gt;&lt;%= best_in_place node, :name, as: :input, activator: "#edit-node-title-#{node.id}" %&gt; &lt;%= link_to "&lt;i class='fa fa-pencil'&gt;&lt;/i&gt;".html_safe, "#", id: "edit-node-title-#{node.id}" %&gt;&lt;/h5&gt; 
                    &lt;p&gt;&lt;%= best_in_place node.media, :description, as: :input, activator: "#edit-node-desc-#{node.id}" %&gt; &lt;%= link_to "&lt;i class='fa fa-pencil'&gt;&lt;/i&gt;".html_safe, "#", id: "edit-node-desc-#{node.id}" %&gt;&lt;/p&gt;
                                      &lt;p&gt;&lt;%= link_to "See video here", node_path(node) %&gt;&lt;/p&gt;
                                      &lt;% else %&gt;
                    &lt;h5&gt;&lt;%= node.name %&gt;&lt;/h5&gt; 
                    &lt;p&gt;&lt;%= node.media.description %&gt;&lt;/p&gt;
                                      &lt;% end %&gt;                                       
                &lt;/div&gt;
                &lt;!-- Tags --&gt;
                &lt;div class="tags bootstrap-styles clearfix"&gt;
  
                                  &lt;% if controller_name == "nodes" %&gt;
                                  &lt;p&gt;
                                        &lt;button type="button" data-toggle="modal" data-target="#TagUsersModal"&gt;Tag Users&lt;/button&gt;
                                  &lt;/p&gt;
                                  &lt;% end %&gt;
  
                                      &lt;% if node.tagged_users.empty? %&gt;
                    &lt;p class="tagged"&gt;In this video:&lt;/p&gt;
                    &lt;ul&gt;
                      &lt;li&gt;&lt;%= link_to image_tag(node.user.avatar.url, size: "48x48", :class =&gt; "img-circle") , node.user %&gt;&lt;/li&gt;
                    &lt;/ul&gt;
                                      &lt;% else %&gt;
                    &lt;p class="tagged"&gt;In this video:&lt;/p&gt;              
                    &lt;ul&gt;
                      &lt;% node.tagged_users.each do |tagged_user| %&gt;
                                              &lt;!-- &lt;li&gt;&lt;%#= link_to image_tag(tagged_user.avatar.url, size: "48x48", :class =&gt; "img-circle"), tagged_user %&gt;&lt;/li&gt; --&gt;
                                              &lt;li&gt;&lt;p&gt;&lt;%= link_to tagged_user.email, tagged_user %&gt;&lt;/p&gt;&lt;/li&gt;                                           
                                          &lt;% end -%&gt;
                    &lt;/ul&gt;
                                      &lt;% end %&gt;
                &lt;/div&gt;
  </code></pre>
  
  <p>The line that triggers this modal is:</p>
  
  <pre><code>&lt;button type="button" data-toggle="modal" data-target="#TagUsersModal"&gt;Tag Users&lt;/button&gt;
  </code></pre>
  
  <p>It then triggers the modal at the top of the question.</p>