2012-04-21 1 views

답변

0

나는 왜 그렇게하고 싶지는 모르겠지만, 당신이 그것을 할 수 없다고 생각합니다. check_box_tag 도우미의 코드를보고 :

def check_box_tag(name, value = "1", checked = false, options = {}) 
    html_options = { "type" => "checkbox", "name" => name, "id" => sanitize_to_id(name), "value" => value }.update(options.stringify_keys) 
    html_options["checked"] = "checked" if checked 
    tag :input, html_options 
end 

당신이 할 수있는 가장 가까운 전무을 통과하고, 그 id=""을 생성합니다.

+0

테이블 행의 모든 ​​체크 상자에 ID가 필요하지 않습니다. 체크 박스가 그룹화되도록'model_ids []'이름을 사용합니다. id는 결국 서로 중복됩니다. 빈 ID가 유효하지 않습니다. http://stackoverflow.com/questions/6535934/is-an-id-allowed-to-be-empty-in-an-html-tag – m33lky

관련 문제