Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

documented :disable_with, fixes #466

  • Loading branch information...
commit 7e465098a4218c91ec03d59f438d40a3e7aabbbd 1 parent d34186d
@justinfrench authored
Showing with 8 additions and 8 deletions.
  1. +1 −1  README.textile
  2. +7 −7 lib/formtastic/helpers/buttons_helper.rb
View
2  README.textile
@@ -248,7 +248,7 @@ The same can be done for buttons with the @:button_html@ option:
<% semantic_form_for @post do |form| %>
...
<% form.buttons do %>
- <%= form.commit_button :button_html => { :class => "primary" } %>
+ <%= form.commit_button :button_html => { :class => "primary", :disable_with => 'Wait...' } %>
<% end %>
<% end %>
</pre>
View
14 lib/formtastic/helpers/buttons_helper.rb
@@ -127,7 +127,7 @@ module ButtonsHelper
# <% semantic_form_for @post do |f| %>
# ...
# <%= f.buttons do %>
- # <%= f.commit_button :label => "Go", :input_html => { ... }, :wrapper_html => { ... }
+ # <%= f.commit_button :label => "Go", :button_html => { :class => "pretty" :disable_with => "Wait..." }, :wrapper_html => { ... }
# <% end %>
# <% end %>
#
@@ -214,14 +214,14 @@ def buttons(*args, &block)
# <%= f.commit_button "Go" %>
#
# @example Pass HTML attributes down to the `<input>`
- # <%= f.commit_button :button_html => { :class => 'pretty', :accesskey => 'g' } %>
- # <%= f.commit_button :label => "Go", :button_html => { :class => 'pretty', :accesskey => 'g' } %>
- # <%= f.commit_button "Go", :button_html => { :class => 'pretty', :accesskey => 'g' } %>
+ # <%= f.commit_button :button_html => { :class => 'pretty', :accesskey => 'g', :disable_with => "Wait..." } %>
+ # <%= f.commit_button :label => "Go", :button_html => { :class => 'pretty', :accesskey => 'g', :disable_with => "Wait..." } %>
+ # <%= f.commit_button "Go", :button_html => { :class => 'pretty', :accesskey => 'g', :disable_with => "Wait..." } %>
#
# @example Pass HTML attributes down to the `<li>` wrapper
- # <%= f.commit_button :button_html => { :class => 'special', :id => 'whatever' } %>
- # <%= f.commit_button :label => "Go", :button_html => { :class => 'special', :id => 'whatever' } %>
- # <%= f.commit_button "Go", :button_html => { :class => 'special', :id => 'whatever' } %>
+ # <%= f.commit_button :wrapper_html => { :class => 'special', :id => 'whatever' } %>
+ # <%= f.commit_button :label => "Go", :wrapper_html => { :class => 'special', :id => 'whatever' } %>
+ # <%= f.commit_button "Go", :wrapper_html => { :class => 'special', :id => 'whatever' } %>
#
# @option *args :label [String, Symbol]
# Override the label text with a String or a symbold for an i18n translation key
Please sign in to comment.
Something went wrong with that request. Please try again.