简体   繁体   English

如何在bootstrap-sass gem上实现boostrap模板

[英]How to implement a boostrap template over bootstrap-sass gem

I have a ROR app using the bootstrap-sass gem and I want to load a template that I purchased onto the app and override the regular bootstrap. 我有一个使用bootstrap-sass gem的ROR应用程序,我想将我购买的模板加载到该应用程序上并覆盖常规的bootstrap。 The template gave me the following files... 该模板为我提供了以下文件...

- template (The Project template) 
- - bootstrap  (All Bootstrap files. We keep all of them in this folder to make updates easily)
- - css  (CSS files of the template)
- - - skins  (CSS skin files)
- - fonts (External font libraries)
- - - font-awesome
- - - fontello
- - images  (All the images of the template)
- - js  (Javascript files of the template)
- - less  (All the less files)
- - php  (PHP files of the template)
- - plugins  (All external libs. We keep all of them in this folder to make updates easily.)
- - videos  (All video files)

I have this tree of files loaded in my lib/assets file but I cannot see how to access them. 我在lib / assets文件中加载了这棵文件树,但看不到如何访问它们。 According to the docs this should access the files but it doesn't seem to work. 根据文档,这应该访问文件,但似乎不起作用。

<!-- Web Fonts -->
<link href='https://fonts.googleapis.com/css?family=Roboto:400,300,300italic,400italic,500,500italic,700,700italic' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Raleway:700,400,300' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Pacifico' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=PT+Serif' rel='stylesheet' type='text/css'>

<!-- Bootstrap core CSS -->
<link href="stylesheets/bootstrap.css" rel="stylesheet">

<!-- Font Awesome CSS -->
<link href="fonts/font-awesome/css/font-awesome.css" rel="stylesheet">

<!-- Fontello CSS -->
<link href="fonts/fontello/css/fontello.css" rel="stylesheet">

<!-- Plugins -->
<link href="plugins/magnific-popup/magnific-popup.css" rel="stylesheet">
<link href="plugins/rs-plugin/css/settings.css" rel="stylesheet">
<link href="stylesheets/animations.css" rel="stylesheet">
<link href="javascripts/plugins/owl-carousel/owl.carousel.css" rel="stylesheet">
<link href="plugins/owl-carousel/owl.transitions.css" rel="stylesheet">
<link href="plugins/hover/hover-min.css" rel="stylesheet">

<!-- the project core CSS file -->
<link href="stylesheets/style.css" rel="stylesheet" >

<!-- Color Scheme (In order to change the color scheme, replace the blue.css with the color scheme that you prefer)-->
<link href="css/skins/light_blue.css" rel="stylesheet">

<!-- Custom css -->
<link href="/stylesheets/custom.css" rel="stylesheet">

I cant seem to access any files. 我似乎无法访问任何文件。 I am using the gem 'bootstrap-sass', '~> 3.2.0' 我正在使用gem'bootstrap-sass','〜> 3.2.0'

I tried importing files into my application.scss file 我尝试将文件导入到application.scss file

@import "bootstrap";
@import "custom";
@import "style";
@import "animate";
@import "animations";

I keep getting errors on my log that show... 我的日志中不断显示错误...

Started GET "/stylesheets/custom.css" for 10.0.2.2 at 2015-11-24 19:11:15 +0000

ActionController::RoutingError (No route matches [GET] "/stylesheets/custom.css"):,etc...

I am not sure how to access the files in development or production. 我不确定如何在开发或生产中访问文件。

I recommend you start by reading The Asset Pipeline documentation: http://guides.rubyonrails.org/asset_pipeline.html 我建议您先阅读资产管道文档: http : //guides.rubyonrails.org/asset_pipeline.html

One thing I noticed is you added the files to: lib/assets, I recommend you put them in vendor\\assets like so: 我注意到的一件事是您将文件添加到了:lib / assets,我建议您将它们放在vendor\\assets如下所示:

这是目录的样子,实际上我也有一些文件

Then you'll need to add those respective files to both your Javascript (application.js) and your Stylesheet (stylesheet.css.scss) manifests like you are doing above. 然后,您需要像上述一样将这些文件分别添加到Javascript(application.js)和Stylesheet(stylesheet.css.scss)清单中。

And Just fyi, several of the libraries you have there are available as gems, they usually make it easier to add assets to your projects. 而且,您所拥有的几个库都可以作为宝石使用,它们通常使向项目中添加资产变得更加容易。 I know owl-caroussel has a gem and so does font-awesome. 我知道猫头鹰-胡萝卜有宝石,字体也很棒。

Hope that helps! 希望有帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM