Fix the CustomFormBuilder example

This commit is contained in:
Francisco J 2011-04-30 16:00:12 +02:00
parent 9113f56848
commit 60071ca76b
1 changed files with 3 additions and 2 deletions

View File

@ -428,8 +428,9 @@ Create a helper method that calls simple_form_for with a custom builder:
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)
def input(attribute_name, options = {}, &block)
options[:input_html].merge! :class => 'custom'
super
end
end