Rails 4 Turbolinks make form submit multiple times
Solved this by moving = javascript_include_tag "application", "data-turbolinks-track" => true
from body to head, thanks all your help
Rails remote form submitting multiple times with 'enter'
When using turbolinks, it's important that you add event handlers using the correct method. Do not place any Javascript in your HTML body tag. Use the turbolinks documentation to determine which events you need to hook into to add your own event handlers or make other transformations of page elements.
Current version of turbolinks: https://github.com/turbolinks/turbolinks#full-list-of-events
Older version of turbolinks: https://github.com/turbolinks/turbolinks-classic#events
The current version also has some recommendations on making your document changes idempotent, which I would do for adding event listeners as well.
Devise registration submitting form twice?
Strange issue - the best thing I can suggest is it might be a turbolinks
issue
The way to test this will either be to remove Turbolinks from your app for the time being, or to disable turbolinks explicitly on your form. If this works, it will generally mean you have a setting / argument somewhere which will be triggering the turbolinks
activity:
#application.js
//= require jquery
//= require jquery_ujs
//= require turbolinks <- remove
//= require twitter/bootstrap
//= require bootstrap-select
//= require moment
//= require bootstrap-datetimepicker
//= require jquery.payment
//= require zeroclipboard
//= require_tree .
#app/views/layouts/application.html.erb
stylesheet_link_tag "application", media: "all"
#app/views/devise/registrations/new.html.erb
<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), html: {class: 'form-signin', role: 'form'}, data: { no_turbolink: true }) do |f| %>
Related Topics
How to Dynamically Modify <Select> in Materialize CSS Framework
Generate Dynamic CSS Based on Variables Angular
Can Jquery Change CSS Style Definition? (Not Individual CSS of Each Element)
Toggle Visibility Property of Div
Manipulating CSS with JavaScript
Refused to Load the Script Because It Violates the Following Content Security Policy Directive
Phonegap - Save Image from Url into Device Photo Gallery
Polymer Share Styles Across Elements
Serving Gzipped CSS and JavaScript from Amazon Cloudfront via S3
Screen Styling When Virtual Keyboard Is Active
Add CSS Rule via Jquery for Future Created Elements
Disable Underline for Lowercase Characters: G Q P J Y
"Force Reflow" in CSS Transitions in Bootstrap
Using Jquery to Know When @Font-Face Fonts Are Loaded
Controller Not a Function, Got Undefined, While Defining Controllers Globally
Difference Between Innertext, Innerhtml and Value
Finding the Max Value of an Attribute in an Array of Objects