gpt4 book ai didi

javascript - 如何通过 bootstrap-sass gem 实现 boostrap 模板

转载 作者:太空宇宙 更新时间:2023-11-04 11:07:10 27 4
gpt4 key购买 nike

我有一个使用 bootstrap-sass gem 的 ROR 应用程序,我想将我购买的模板加载到该应用程序上并覆盖常规 Bootstrap 。该模板为我提供了以下文件...

- 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)

我在我的 lib/assets 文件中加载了这个文件树,但我看不到如何访问它们。根据文档,这应该可以访问文件,但它似乎不起作用。

<!-- 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">

我似乎无法访问任何文件。我正在使用 gem 'bootstrap-sass', '~> 3.2.0'

我尝试将文件导入我的 application.scss 文件

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

我的日志中不断出现错误,显示...

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...

我不确定如何访问开发或生产中的文件。

最佳答案

我建议您先阅读 Assets 管道文档:http://guides.rubyonrails.org/asset_pipeline.html

我注意到的一件事是您将文件添加到:lib/assets,我建议您将它们放在 vendor\assets 中,如下所示:

Here is how my directory looks, I actually also have some of the files you have

然后您需要将这些相应的文件添加到您的 Javascript (application.js) 和样式表 (stylesheet.css.scss) list 中,就像您在上面所做的那样。

仅供引用,您拥有的几个库都可以作为 gem 使用,它们通常可以更轻松地将 Assets 添加到您的元素中。我知道 owl-caroussel 有一个 gem,font-awesome 也有。

希望对您有所帮助!

关于javascript - 如何通过 bootstrap-sass gem 实现 boostrap 模板,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33886986/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com