lib/has_enum/formtastic.rb in has_enum-0.8.0 vs lib/has_enum/formtastic.rb in has_enum-0.8.1
- old
+ new
@@ -1,10 +1,13 @@
Formtastic::SemanticFormBuilder.class_eval do
def enum_input(method, options = {})
- options.merge! :collection => object.class.values_for_select_tag(method),
- :wrapper_html => {:class => :enum}
- select_input method, options
+ options.merge! :collection => object.class.values_for_select_tag(method)
+ if object.class.has_mutliple_enum? method
+ check_boxes_input method, options
+ else
+ select_input method, options.merge(:wrapper_html => {:class => :enum})
+ end
end
def default_input_type_with_enum(method, options={})
if object.class.respond_to?(:enums) && object.class.has_enum?(method)
:enum