我已经渲染了选择。但我不能为我的标签标签添加“for”属性。它是如何正确的?谢谢。
i = 1
counties.each do |county|
li class: "city" do
span id: "check_#{i}" do
check_box_tag county.name, county.id
end
label for: "check_#{i}", class: "city-name-main" do
county.name
end
i += 1
end
end