加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails – 使用bootstrap_form gem时遇到问题 – 无法找

发布时间:2020-12-17 01:37:14 所属栏目:百科 来源:网络整理
导读:我正在尝试使用bootstrap_form~ 2.0.1宝石(见 https://github.com/bootstrap-ruby/rails-bootstrap-forms),但它给了我适合.我按照github页面上的说明安装,将其添加到我的Gemfile中: gem 'bootstrap_form','~ 2.0.1' 我运行了bundle install.然后我将它添加
我正在尝试使用bootstrap_form~> 2.0.1宝石(见 https://github.com/bootstrap-ruby/rails-bootstrap-forms),但它给了我适合.我按照github页面上的说明安装,将其添加到我的Gemfile中:

gem 'bootstrap_form','~> 2.0.1'

我运行了bundle install.然后我将它添加到我的application.css.scss文件中:

*= require_self
 *= require rails_bootstrap_forms
 *= require_tree .

但是,当我尝试运行我的应用程序时,我得到:

couldn’t find file ‘rails_bootstrap_forms’ (in /path/to/my/app/assets/stylesheets/application.css.scss:12)

我显然错过了一些东西.我检查了lib / assets /和vendor / assets / stylesheets /但是那里什么都没有.同样,app / assets / stylesheets /中没有任何内容.

什么是软糖?

解决方法

您必须在app / assets / stylesheets中创建文件rails_bootstrap_form.css

.rails-bootstrap-forms-date-select,.rails-bootstrap-forms-time-select,.rails-bootstrap-forms-datetime-select {
  select {
    display: inline-block;
    width: auto;
  }
}
.rails-bootstrap-forms-error-summary {
  margin-top: 10px;
}

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读