simplify unsplatting syntax
This commit is contained in:
parent
67f812cabb
commit
881452d707
|
@ -23,7 +23,7 @@ module SimpleForm
|
||||||
else
|
else
|
||||||
options[:builder] ||= SimpleForm::FormBuilder
|
options[:builder] ||= SimpleForm::FormBuilder
|
||||||
end
|
end
|
||||||
fields_for(*(args << options), &block)
|
fields_for(*args, options, &block)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -113,11 +113,11 @@ module MiscHelpers
|
||||||
end
|
end
|
||||||
|
|
||||||
def custom_form_for(object, *args, &block)
|
def custom_form_for(object, *args, &block)
|
||||||
simple_form_for(object, *(args << { builder: CustomFormBuilder }), &block)
|
simple_form_for(object, *args, { builder: CustomFormBuilder }, &block)
|
||||||
end
|
end
|
||||||
|
|
||||||
def custom_mapping_form_for(object, *args, &block)
|
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
|
end
|
||||||
|
|
||||||
def with_concat_form_for(*args, &block)
|
def with_concat_form_for(*args, &block)
|
||||||
|
@ -151,7 +151,7 @@ end
|
||||||
|
|
||||||
class CustomFormBuilder < SimpleForm::FormBuilder
|
class CustomFormBuilder < SimpleForm::FormBuilder
|
||||||
def input(attribute_name, *args, &block)
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue