Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix :wrapper_html :class and :button_html :class options

This appears to fix the options functionality retaining both :wrapper_html and :button_html options without actually wrapping the action in another tag.
Only tested with class and ensured that id also remains but not sure what it does with other options.

Default class is "btn"
:wrapper_html => { :class => "wrapper-option" } is prefixed with the default and results in class="btn wrapper-option"
:button_html => { :class => "button-option" } will specify the whole class value and results in class="button-option"
  • Loading branch information...
commit 136c3bc0269014d28acd8da9b93d49ae4e1caf1e 1 parent 7fbf610
@nickl- nickl- authored
Showing with 10 additions and 5 deletions.
  1. +10 −5 lib/formtastic-bootstrap/actions/base.rb
View
15 lib/formtastic-bootstrap/actions/base.rb
@@ -4,17 +4,22 @@ module Base
# Bootstrap doesn't have wrappers.
def wrapper(&block)
- # TODO Detect if user passed wrapper_html_options and issue
- # a warning that they're ignored. (See the original in
- # Formtastic.)
template.capture(&block)
end
+ # Default button class
+ def default_wrapper_classes
+ ["btn"]
+ end
+
+ # :wrapper_html member :class is prefixed with btn
+ # :button_html member :class is all encompassing
def default_button_html
{
:accesskey => accesskey,
- :class => "btn"
- }
+ :class => wrapper_class.strip,
+ :id => wrapper_id
+ }
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.