rails check_box_tag set checked with default value

后端 未结 6 1568
说谎
说谎 2021-02-18 14:38

I currently have a rails check_box_tag call that looks like

check_box_tag #{name}

I want to include a checked attribute, which I know I can do

6条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-18 14:43

    Just wanted to update this. The third parameter for check_box_tag is a boolean value representing the checked status.

    check_box_tag name, value, true
    

提交回复
热议问题