Support options

Signed-off-by: Kenji Okimoto <okimoto@clear-code.com>
This commit is contained in:
Kenji Okimoto 2018-06-15 15:00:38 +09:00
parent 51e76524d9
commit e0557c5697
No known key found for this signature in database
GPG Key ID: F9E3E329A5C5E4A1

View File

@ -34,14 +34,14 @@ class FluentdFormBuilder < ActionView::Helpers::FormBuilder
end
def bool_field(key, options)
check_box(key, {}, "true", "false") + " " +
check_box(key, options, "true", "false") + " " +
label(key, nil, data: { toggle: "tooltip", placement: "right" }, title: object.desc(key))
end
def other_field(key, options)
return unless object.respond_to?(key)
label(key, nil, data: { toggle: "tooltip", placement: "right" }, title: object.desc(key)) +
text_field(key, class: "form-control")
text_field(key, class: "form-control", **options)
end
def render_section(key, options)