Permalink
Browse files

Use the helper to set the default form builder.

  • Loading branch information...
tylerhunt committed Dec 4, 2012
1 parent 68892f1 commit eed235514e85b1b289696ac34d9ba1d1b195ea2f
Showing with 2 additions and 3 deletions.
  1. +1 −3 lib/formulate/engine.rb
  2. +1 −0 lib/formulate/form_helper.rb
View
@@ -2,9 +2,7 @@
module Formulate
class Engine < ::Rails::Engine
- initializer 'formulate.initialize', before: 'action_view.set_configs' do |app|
- app.config.action_view.default_form_builder = Formulate::FormBuilder
-
+ initializer 'formulate.initialize' do |app|
ActiveSupport.on_load(:action_view) do
include Formulate::FormHelper
end
@@ -4,6 +4,7 @@ module FormHelper
def form_for(record, options={}, &proc)
options[:html] ||= {}
+ options[:builder] ||= FormBuilder
case record
when String, Symbol

0 comments on commit eed2355

Please sign in to comment.