Я хочу иметь onepager с разными файлами css, javascript и изображений для использования в качестве моей целевой страницы для моего приложения.require_tree аргумент должен быть каталогом
Я переместил свой css в папку поставщика/активов под подпапкой под названием onepager. Я использовал подпапку, потому что я буду использовать эти файлы только для onepager, а не для чего-либо еще.
например.
vendor/assets/stylesheets/onepager/
Я создал отдельный макет, который ссылается на отдельные файлы css. > Onepager.html.erb
<%= stylesheet_link_tag 'onepager', media: 'all', 'data-turbolinks-track' => true %>
<%= javascript_include_tag 'onepager', 'data-turbolinks-track' => true %
в файлах onepager.js и onepager.css.scss Я хочу, чтобы ссылаться на файлы в поставщика/активов/ххх/onepager/папки. Я добавил следующий код, но получаю сообщение об ошибке.
onepager.css.scss
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
* compiled file so the styles you add here take precedence over styles defined in any styles
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new
* file per style scope.
*
*= require_tree ./onepager/
*/
onepager.js
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
* compiled file so the styles you add here take precedence over styles defined in any styles
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new
* file per style scope.
*
*= require_tree ./onepager/
*/
Я получаю ошибку, что требуется дерево не является каталогом? Это странно, потому что это каталог, и я полагаю, что файлы в активах поставщика загружаются автоматически?
Как это исправить?
require_tree аргумент должен быть каталогом (в /home/ubuntu/workspace/app/assets/stylesheets/onepager.css.scss:13)
Вы помечено это с 'рубин-на-rails',' рубин-на-рельсы-3' и 'рубин-на-рельсы-4'. Какую версию вы используете. Исправьте свои теги. –