title: Rails `remote: true` not making AJAX request
body: <p>My app uses Rails 5.1 and whenever I click on a <code>link_to</code> with <code>remote: true</code> I get an <code>InvalidCrossOriginRequest</code> error. After turning off forgery protection the app ends up making a full <code>GET</code> request to the server and displays the javascript.</p>
  
  <p><em>Here is the link:</em></p>
  
  <pre><code>= link_to 'Example', example_url, remote: true
  </code></pre>
  
  <p><em>example.js.erb:</em></p>
  
  <pre><code>$('.example').html('alert("example message")');
  </code></pre>
  
  <p><em>Route:</em></p>
  
  <pre><code>scope :js, defaults: { format: :js } do
      #### Example
      get 'example', to: 'examples#example'
  end
  </code></pre>
  
  <p><em>Controller:</em></p>
  
  <pre><code>def example
      respond_to do |format|
          format.html { redirect_to root_url, alert: 'Page not accessible' }
          format.js
      end
  end
  </code></pre>
  
  <hr>
  
  <p>I included the javascript in my template:</p>
  
  <pre><code>= javascript_include_tag 'application', 'data-turbolinks-track': 'reload'
  </code></pre>
  
  <p>And I added the necessary js asset paths:</p>
  
  <pre><code>//= require_self
  
  // jQuery
  //= require jquery
  //= require jquery_ujs
  </code></pre>