Skip to content
Browse files

documented :disable_with, fixes #466

  • Loading branch information...
1 parent 62cadee commit 11f725d13aa7db9f09d467cc48090ab96becf916 @justinfrench committed
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

0 comments on commit 11f725d

Please sign in to comment.
Something went wrong with that request. Please try again.