title: Rails 3 remote link click triggers different request on second click
body: <p>I have a Rails app that was working well until I upgraded ruby, rubygems, and my gems. </p>
  
  <p>Almost all of my links are remote links. When I make the first request by clicking on one of these links, Fancybox is triggered and opens the new content correctly. When I close the box and click the same link again the request that is generated is completely different. It requests the index and consequently Fancybox is populated with the index response.</p>
  
  <p>Sample link:</p>
  
  <pre><code>&lt;a href="/companies/87/edit" data-remote="true"&gt;Handmade Design&lt;/a&gt;
  </code></pre>
  
  <p>First request:</p>
  
  <pre><code>Started GET "/companies/89/edit" for 127.0.0.1 at 2013-03-18 15:34:26 -0700
  Processing by CompaniesController#edit as JS
  </code></pre>
  
  <p>Second request:</p>
  
  <pre><code>Started GET "/companies" for 127.0.0.1 at 2013-03-18 15:34:26 -0700
  Processing by CompaniesController#index as */*
  </code></pre>
  
  <p>I'm relying on the jquery-rails gem, fancybox, and the remotipart gem if that helps. Since these were all updated it seems like the error could be in one of these areas, but that fact that the requests are totally different makes me think it's something with Rails formats. Here is what the edit action looks like in the Companies controller:</p>
  
  <pre><code>#/controllers/companies_controller.rb
  respond_to :html, :json
  respond_to :js,   :only =&gt; [:new, :create, :edit, :update, :destroy]
  
  # ...
  
  # GET /companies/1/edit
  def edit
    respond_with @company
  end
  </code></pre>
  
  <p>I use a before filter to grab the company. </p>
  
  <p>Any help or clues would be much appreciated.</p>
  
  <p>UPDATE</p>
  
  <p>The second request appears to always be a request for the current page.</p>
  
  <p>UPDATE</p>
  
  <p>I've isolated this to a JS issue. It appears to not be an issue with Rails or remote links.</p>