1
0
Fork 0
mirror of https://github.com/heartcombo/simple_form.git synced 2022-11-09 12:19:26 -05:00

simplify unsplatting syntax

This commit is contained in:
Ilya Vorontsov 2013-04-21 19:08:00 +04:00
parent 67f812cabb
commit 881452d707
2 changed files with 4 additions and 4 deletions

View file

@ -23,7 +23,7 @@ module SimpleForm
else
options[:builder] ||= SimpleForm::FormBuilder
end
fields_for(*(args << options), &block)
fields_for(*args, options, &block)
end
end
end

View file

@ -113,11 +113,11 @@ module MiscHelpers
end
def custom_form_for(object, *args, &block)
simple_form_for(object, *(args << { builder: CustomFormBuilder }), &block)
simple_form_for(object, *args, { builder: CustomFormBuilder }, &block)
end
def custom_mapping_form_for(object, *args, &block)
simple_form_for(object, *(args << { builder: CustomMapTypeFormBuilder }), &block)
simple_form_for(object, *args, { builder: CustomMapTypeFormBuilder }, &block)
end
def with_concat_form_for(*args, &block)
@ -151,7 +151,7 @@ end
class CustomFormBuilder < SimpleForm::FormBuilder
def input(attribute_name, *args, &block)
super(attribute_name, *(args << { input_html: { class: 'custom' } }), &block)
super(attribute_name, *args, { input_html: { class: 'custom' } }, &block)
end
end