Skip to content
Browse files

Work with Formtastic::Bootstrap::Formbuilder

This should be configurable
  • Loading branch information...
1 parent 486e0f0 commit 89ddc054e0352df55b6e4fb2a0649a567ee15f89 @joevandyk committed
Showing with 10 additions and 1 deletion.
  1. +10 −1 lib/nested_form/builders.rb
View
11 lib/nested_form/builders.rb
@@ -15,7 +15,16 @@ class SimpleBuilder < ::SimpleForm::FormBuilder
begin
require 'formtastic'
- class FormtasticBuilder < (defined?(::Formtastic::FormBuilder) ? Formtastic::FormBuilder : ::Formtastic::SemanticFormBuilder)
+ parent_klass =
+ if defined?(::FormtasticBootstrap)
+ FormtasticBootstrap::FormBuilder
+ elsif defined?(::Formtastic::FormBuilder)
+ Formtastic::FormBuilder
+ else
+ ::Formtastic::SemanticFormBuilder
+ end
+
+ class FormtasticBuilder < parent_klass
include ::NestedForm::BuilderMixin
end
rescue LoadError

0 comments on commit 89ddc05

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