title: Error: Can't verify CSRF token authenticity rails
body: <p>I am submitting a form in Rails4 from Modal. This solution was working fine in Rails 3.x</p>
  
  <p>The code is as following:</p>
  
  <pre><code> &lt;div class="modal fade" id="copy-product-addons"&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"&gt;×&lt;/button&gt;
          &lt;h4&gt;Copy Add-Ons From:&lt;/h4&gt;
        &lt;/div&gt;
        &lt;div class="modal-body"&gt;
          &lt;form id="addons-copy" method="POST" action="&lt;%= copy_addons_product_path(@product) %&gt;"&gt;
            &lt;%= select_tag "from", options_from_collection_for_select(@shop.enabled_products - [@product], 'id', 'name'),  :class =&gt; "form-control %&gt;
          &lt;/form&gt;
        &lt;/div&gt;
        &lt;div class="modal-footer"&gt;
          &lt;a href="#" class="btn btn-danger" data-dismiss="modal"&gt;Cancel&lt;/a&gt;
          &lt;a href="#" onclick="$('#addons-copy').submit(); return false;" class="btn btn-primary"&gt;Copy Add-ons&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>As a response, instead of executing specific action it re-directs me to Login page by login me out.</p>
  
  <p>The response in terminal looks like:</p>
  
  <pre><code>&gt; Started POST "/products/10168/copy_addons" for 127.0.0.1 at 2016-01-10
  &gt; 21:19:10 +0100 Processing by ProductsController#copy_addons as HTML  
  &gt; Parameters: {"from"=&gt;"10130", "id"=&gt;"10168"} Can't verify CSRF token
  &gt; authenticity Redirected to http://myr-d.dev/login Filter chain
  &gt; halted as :require_login rendered or redirected
  </code></pre>
  
  <p>Thank you</p>