Rails4的icheck-rails gem

时间:2014-10-05 17:34:33

标签: ruby-on-rails ruby-on-rails-3 ruby-on-rails-4

我正在运行一个问题,同时集成了这个gem,在THIS url中有一个部分说:

iCheck includes several skins, most of them with multiple color schemes. Include them like this:  
@import 'icheck/square/blue' 
@import 'icheck/square/green'

我尝试在app / assets / stylesheets / application.css的末尾添加上面的行,但样式没有影响。在场景背后Javascript工作正常,它在给定的HTML下面呈现:

<div class="icheckbox_square-blue" style="position: relative;">
    <input type="checkbox" data-color="blue" data-skin="square" class="icheck-me" style="position: absolute; opacity: 0;">
    <ins class="iCheck-helper" style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: none repeat scroll 0% 0% rgb(255, 255, 255); border: 0px none; opacity: 0;"></ins>
</div>

1 个答案:

答案 0 :(得分:0)

为了让iCheck gem在Rails 4中工作,请按照THIS URL中提到的所有内容进行操作,但执行以下更改以成功运行它:

不要像iCheck Gem doc所说的那样导入样式表:

@import 'icheck/square/blue'
@import 'icheck/square/green' 

在你的application.css中 - 以这种方式添加:

 *= require icheck/square/blue
 *= require icheck/square/green