0

please forgive my newbieness here - I am trying to get the gem rails-bootstrap-toggle-buttons to work in the rails app. I searched all over and can't figured it out. I have tried wrappers, but can't get it to work. Any help would be appreciated!!

link to gem: https://github.com/caarlos0/rails-bootstrap-toggle-buttons

link to gem source: https://github.com/nostalgiaz/bootstrap-switch

I am trying to produce this:

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

the code works great in the site but when I try to add it to simple_form then it goes down hill.

using Simple_forms :

= f.input :home_address

I had added :id=>"checkbox" and I have read the docs on the gem's site but I am very new at this and after 4 hours I am still not getting it Thanks!

4

1 回答 1

0

请注意,您的代码中必须具有<div>withdata属性。如果您只是放置简单的旧simple_form代码,例如f.input,它只会创建输入,而不是<div>包含重要内容的包装。

于 2013-04-16T20:57:35.013 回答