diff --git a/config/initializers/form_builder.rb b/config/initializers/form_builder.rb new file mode 100644 index 0000000000..71b6038dd7 --- /dev/null +++ b/config/initializers/form_builder.rb @@ -0,0 +1,15 @@ +# +# Allow some application_helper methods to be used in the scoped form_for manner +# +class ActionView::Helpers::FormBuilder + def field_container(method, options = {}, &block) + @template.field_container(@object_name,method,options,&block) + end + + def error_message_on(method, options = {}) + @template.error_message_on(@object_name, method, objectify_options(options)) + end +end + +ActionView::Base.field_error_proc = Proc.new{ |html_tag, instance| "#{html_tag}".html_safe } +