ruby-on-railsformtastic

disable_with not working in Rails 4.2.6


I am using disable_with for submit button, it is working fine in Rails 3.2 but not working in Rails 4.2.6. This is my form where I am using disable_with:

<%= semantic_form_for(@account, :url => account_create_path, :html => { :multipart => true, :class => 'acc_create'}) do |f| %>
  <%= u.input :name, :input_html => {:placeholder => "Name", :value => @account.user.name} %>
  <%= u.input :email, :input_html => {:placeholder => "Email", :value => @account.user.email} %>
  <%= f.buttons do %>
    <%= f.commit_button :label => 'Create My Account', :button_html => {:class => 'register  button', :disable_with => 'Wait...', :id => 'user_submit'} %>
  <% end %>
<% end %>

Please help.


Solution

  • Please try this:

    <%= f.commit_button :label => 'Create My Account', :button_html => {:class => 'register  button', 'data-disable-with' => 'Wait...', :id => 'user_submit'} %>