gpt4 book ai didi

ruby-on-rails - 在 check_box_tag 中添加一个类

转载 作者:行者123 更新时间:2023-12-04 05:58:51 25 4
gpt4 key购买 nike

我在网上搜索,找不到方法。到目前为止,我已经尝试过:

<%= check_box_tag "course[location_ids][]", location.id, class: 'checkbox-inline'%>

这将输出:
input type: "checkbox" name="course[location_ids][] id="course_location_ids_" value="1" checked="checked"

出于某种原因,它会进行检查输入。
<%= check_box_tag "course[location_ids][]", location.id, :class => 'checkbox-inline'%>

和第一个一样

如何在 check_box_tag 中添加一个类

最佳答案

您没有使用正确的格式

check_box_tag(name, value = "1", checked = false, options = {})


将标签更改为以下内容:
<%= check_box_tag "course[location_ids][]", location.id, false, class: 'checkbox-inline'%>

注:第三个选项是检查值,您需要根据需要更改它

引用: check_box_tag

关于ruby-on-rails - 在 check_box_tag 中添加一个类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44203144/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com