【问题标题】:bootstrap in rails -- no bootstrap.css导轨中的引导程序——没有 bootstrap.css
【发布时间】:2014-06-09 15:25:14
【问题描述】:

我有一个 ruby​​ on rails 应用程序。我使用bootstrap-sass gem 并按照以下说明添加了引导程序:

https://github.com/twbs/bootstrap-sass

但是,我认为某些引导样式未导入。例如使用class=panel 没有做任何事情。另外,当我在浏览器中View page source 时,我看不到任何这样的行

<link data-turbolinks-track='true' href='/assets/bootstrap.css'>

我的解决方案是将bootstrap.css 复制到app/assets/stylesheets 文件夹中。是应该这样做还是我有更好的方法?

谢谢。

【问题讨论】:

    标签: html css ruby-on-rails ruby twitter-bootstrap


    【解决方案1】:

    对于非 sass 方法:

    https://github.com/seyhunak/twitter-bootstrap-rails

    我使用了这个 gem,它也有一个与之关联的 Railscast,以便在我的 Rails 应用程序中使用 Twitter Bootstrap。

    否则要手动配置引导程序,将 href 更改为 href="/stylesheets/bootstrap.css" 应该可以解决问题。确保也包含 jQuery 链接。

    【讨论】:

    • 感谢您的回复。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-09-03
    • 2023-03-30
    相关资源
    最近更新 更多