Confusion in the supplier folder

Firstly, I have the following star catalogs installed:

application.js

//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require_tree .

application.css

*= require_self
*= require_tree .

However a simple test file in the provider

console.log('I\'ve been loaded,baby!');

not loading with asterisks? If I translate it to app / assets / js, it works then, but not at the provider. What directives do I need to configure for this to work? Are they required individually?

Do I need to precompile even in development?

In addition, there is vendorno catalog images. Many third-party scripts have demos with them. I would prefer them in vendor/imagesrather than app/assets/images. Can this be customized?

0
source share
1 answer

According to Rails

: /, lib/ /

, .

:

app/assets/js, , .

- require_tree, application.js, javascript, (application.js), .. app/assets/javascripts

//= require_tree .

javascript vendor/assets/javascripts, vendor.

, ? ?

, application.js.

, vendor/javascripts/abc_vendor.js vendor/stylesheets/abc_vendor.css

application.js

//= require abc_vendor

application.css

*= require abc_vendor

- . /, //. ?

. . images vendor/assets. . , abc_logo.jpg vendor/assets/images. . :

<%= image_tag "abc_logo.jpg" %>
0

Source: https://habr.com/ru/post/1691190/


All Articles