Extract html class

Signed-off-by: Kenji Okimoto <okimoto@clear-code.com>
This commit is contained in:
Kenji Okimoto 2018-06-20 15:24:50 +09:00
parent a5300c022b
commit 771b594f98
No known key found for this signature in database
GPG Key ID: F9E3E329A5C5E4A1

View File

@ -58,9 +58,10 @@ class FluentdFormBuilder < ActionView::Helpers::FormBuilder
section_class = object.class._sections[key] section_class = object.class._sections[key]
children = object.__send__(key) || { "0" => {} } children = object.__send__(key) || { "0" => {} }
html = "" html = ""
html_class = "js-nested-column #{section_class.multi ? "js-multiple" : ""}"
children.each do |index, child| children.each do |index, child|
html << content_tag("div", class: "js-nested-column #{section_class.multi ? "js-multiple" : ""}") do html << content_tag("div", class: html_class) do
_html = "" _html = ""
_html << append_and_remove_links if section_class.multi _html << append_and_remove_links if section_class.multi
_html << label(key, nil, data: { toggle: "tooltip", placement: "right" }, title: object.desc(key)) _html << label(key, nil, data: { toggle: "tooltip", placement: "right" }, title: object.desc(key))