2016-07-20 8 views
0

Ich benutze disable_with für die Schaltfläche zum Senden, es funktioniert gut in Rails 3.2, funktioniert aber nicht in Rails 4.2.6. Das ist meine Form ist, wo ich bin mit disable_with:disable_with funktioniert nicht in Rails 4.2.6

<%= 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 %> 

Bitte helfen.

Antwort

1

Bitte versuchen Sie dies:

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

Können Sie die HTML teilen, die von jedem erzeugt wird? Ist disable_with Teil von Schienen oder semantische Form? Das ist nicht der Standard-Formular-Builder

0

Dies funktioniert für Sie

<%= f.commit_button "Create", :button_html => {:class => "btn primary", :disable_with => 'Processing...'} %> 
0
<%= f.submit 'Start Your Membership', :class => 'button', :data => {:disable_with => 'Please Wait...'} %> 

auch benötigen Sie jquery und jquery-UJS Javascripts zu Ihrer Anwendung hinzufügen .

Verwandte Themen