简体   繁体   English

向Ruby in Rails资产管道中添加一个新文件夹

[英]Add a new folder to Ruby in Rails assets pipeline

I'm utilizing a bootstrap template and it requires a plugin for a revolution slider. 我正在使用引导程序模板,它需要一个用于旋转滑块的插件。 I'm used to check the source code of the template and remove individual JS and CSS files it requires and place them in the asset pipeline. 我习惯于检查模板的源代码,并删除其所需的单个JS和CSS文件,并将它们放在资产管道中。 Is there any way to import into the asset pipeline the entire plugin folder with all of its files? 有什么方法可以将整个插件文件夹及其所有文件导入资产管道?

Here is a picture of what the folder contains: 这是文件夹包含的图片:

在此处输入图片说明

UPDATE UPDATE

I've added the rs-plugin to the assets portion of my app: 我已将rs-plugin添加到应用程序的资产部分:

更新

In application.rb I've added the following: application.rb我添加了以下内容:

config.assets.paths << Rails.root.join("assets", "rs-plugin-5")

In assets/javascripts/application.js I've added the following: assets/javascripts/application.js我添加了以下内容:

//= require rs-plugin-5/js/jquery.themepunch.tools.min
//= require rs-plugin-5/js/jquery.themepunch.revolution.min

I am getting the following error: 我收到以下错误:

更新2

是的,您可以通过在config/application.rb添加下一行来做到这一点:

config.assets.paths << Rails.root.join('/path/to/folder')

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

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