19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
# File 'lib/bootstrap2_form_builder.rb', line 19
def bootstrap_form_for(name, *args, &block)
options = args.
target = name
if target.kind_of?(Array)
target = name[1]
end
form_html = {:html => {:class => Bootstrap2FormBuilder.default_form_layout}}
options.merge!(form_html) do |html_key, passed_in_html, default_html|
passed_in_html.merge(default_html) do |key, oldval, newval|
oldval
end
end
partial_location = Bootstrap2FormBuilder.error_partial || "bootstrap2_form_builder/error_messages"
render(partial_location, :target => target) + form_for(name, *(args << options.merge(:builder => Bootstrap2FormBuilder::FormBuilder)), &block)
end
|