Skip to content

Commit

Permalink
Work with Formtastic::Bootstrap::Formbuilder
Browse files Browse the repository at this point in the history
This should be configurable
  • Loading branch information
Joe Van Dyk committed Apr 6, 2012
1 parent 486e0f0 commit 89ddc05
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/nested_form/builders.rb
Expand Up @@ -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
Expand Down

0 comments on commit 89ddc05

Please sign in to comment.