繁体   English   中英

simple_form引导程序中的rails-bootstrap-toggle-buttons不起作用

[英]rails-bootstrap-toggle-buttons in simple_form bootstrap not working

请原谅我的新手-我正在尝试让gem rails-bootstrap-toggle-buttons在rails应用程序中工作。 我到处搜寻,找不到答案。 我已经尝试过包装器,但是无法正常工作。 任何帮助,将不胜感激!!

链接到gem: https : //github.com/caarlos0/rails-bootstrap-toggle-buttons

链接到gem来源: https : //github.com/nostalgiaz/bootstrap-switch

我试图产生这个:

<div class="switch" data-on="primary" data-off="info">
    <input type="checkbox" checked />
</div>

该代码在该站点中效果很好,但是当我尝试将其添加到simple_form时,它就下山了。

使用Simple_forms:

= f。输入:home_address

我已经添加了:id =>“ checkbox”,并且我已经阅读了gem网站上的文档,但是我对此非常陌生,经过4个小时,我仍然没有收到它,谢谢!

请注意,您的代码上必须具有<div>及其data属性。 如果仅放置简单的旧simple_form代码(如f.input ,它将仅创建输入,而不是包装包含重要内容的<div>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM