README.rdoc in simple_form-1.3.0 vs README.rdoc in simple_form-1.3.1
- old
+ new
@@ -368,12 +368,26 @@
SimpleForm has several configuration values. You can read and change them in the initializer created by SimpleForm, so if you haven't executed the command below yet, please do:
rails generate simple_form:install
-== TODO
+== Custom form builder
-Please refer to TODO file.
+You can create a custom form builder that uses SimpleForm.
+
+Create a helper method that calls simple_form_for with a custom builder:
+
+ def custom_form_for(object, *args, &block)
+ simple_form_for(object, *(args << { :builder => CustomFormBuilder }), &block)
+ end
+
+Create a form builder class that inherits from SimpleForm::FormBuilder.
+
+ class CustomFormBuilder < SimpleForm::FormBuilder
+ def input(attribute_name, *args, &block)
+ super(attribute_name, *(args << { :input_html => { :class => 'custom' } }), &block)
+ end
+ end
== Maintainers
* José Valim (http://github.com/josevalim)
* Carlos Antonio da Silva (http://github.com/carlosantoniodasilva)