[LRUG] Double submit

Andrew Stewart boss at airbladesoftware.com
Fri Jan 17 03:50:05 PST 2014


Hello!

[This isn't a Ruby question.]

I have a Rails 3.0.x app with a form generated like this:

    = form_tag foos_search_path, remote: true, method: 'get', :'data-type' => 'html' do
      = text_field_tag :code, params[:code], autofocus: true
      = submit_tag 'Find', disable_with: 'Finding...'

From time to time the server receives a double-submission.  The first looks like this:

    GET /search/foos?utf8=%E2%9C%93&code=blah&commit=Find

And the second, within 1s, looks like this:

    GET /search/foos?utf8=%E2%9C%93&code=blah

This happened just now with someone using Chrome (it's not an IE problem).

I can't reproduce this and I can't figure out how it can happen.  Any ideas?

Thanks in advance,

Andy Stewart


More information about the Chat mailing list