0

我对安装 spree_bootstrap_theme 的指南(https://github.com/Andrewmp1/spree_bootstrap_theme)的理解有些晦涩。你对我有什么建议吗?非常感谢!

以下是我所做的:

  1. 为狂欢创建一个新的沙箱。

  2. 添加到 Gemfile:

    gem 'spree_bootstrap_theme', :git => 'git://github.com/Andrewmp1/spree_bootstrap_theme.git'
    
  3. 将样式表中的 application.css 重命名为 application.css.scss

  4. 在 stylesheets 文件夹中创建一个新文件:bootstrap_and_overrides.css.scss。

  5. 将以下行添加到 bootstrap_and_overrides.css.scss:

    @import 'store/spree_bootstrap_theme';
    
  6. 打开application.js,添加:

    //= require bootstrap
    
  7. 运行 rails 服务器

我收到的结果:http: //imageshack.us/f/405/spreet.png/ 如您所见,布局已损坏。我查看了文件的源代码,没有看到任何关于引导程序的信息。我得到的是这里:

<meta content="Spree demo site" name="description" />
<link href="/assets/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" />
<link href="/assets/normalize.css?body=1" media="screen" rel="stylesheet" type="text/css" />
<link href="/assets/skeleton.css?body=1" media="screen" rel="stylesheet" type="text/css" />
<link href="/assets/store/screen.css?body=1" media="screen" rel="stylesheet" type="text/css" />
<link href="/assets/store/spree_core.css?body=1" media="screen" rel="stylesheet" type="text/css" />
<link href="/assets/store/spree_promo.css?body=1" media="screen" rel="stylesheet" type="text/css" />
<link href="/assets/store/all.css?body=1" media="screen" rel="stylesheet" type="text/css" />
<meta content="authenticity_token" name="csrf-param" />
<meta content="BoSR3FtvQBjqF68s7amtXGMVypmaW68e7tHhRzYvqzw=" name="csrf-token" />
<script src="/assets/jquery.js?body=1" type="text/javascript"></script>
<script src="/assets/jquery_ujs.js?body=1" type="text/javascript"></script>
<script src="/assets/jquery.validate/jquery.validate.min.js?body=1" type="text/javascript">    </script>
<script src="/assets/store/checkout.js?body=1" type="text/javascript"></script>
<script src="/assets/store/product.js?body=1" type="text/javascript"></script>
<script src="/assets/store/cart.js?body=1" type="text/javascript"></script>
<script src="/assets/store/spree_core.js?body=1" type="text/javascript"></script>
<script src="/assets/store/spree_promo.js?body=1" type="text/javascript"></script>
<script src="/assets/store/all.js?body=1" type="text/javascript"></script>

我也尝试将 gem 'bootstrap-sass' 添加到 Gemfile,但两种情况下的结果都与上述相同。

4

2 回答 2

3

我刚刚在样式表/商店中创建了一个文件,名为“spree_bootstrap.scss”,内容如下:

@import 'store/spree_bootstrap_theme'

之后,我从 stylesheets/store/all.css 中删除了下面的代码

*= require store/spree_core
*= require store/spree_promo

对于 javascripts/store/all.js 也是如此:

//= require store/spree_core
//= require store/spree_promo

我在 javascripts/store/all.js::

//= require bootstrap

启动您的服务器,您将看到 spree_bootstrap_theme 的正确样式。

于 2013-03-22T10:07:01.507 回答
0

我认为您不应该将 application.css 重命名为 application.css.scss 。文件 application.css 是一个特殊用途的文件。在这里您可以了解它的格式和语法。

于 2012-11-17T22:19:54.693 回答