How to load vendor asset folder in Rails 4?

ahnbizcad

I have a plugin with many types of files, and its own tree structure (html, css, js, documentation, images, etc)

Rather than going through the plugin folder, and splitting all the css and js files into the vendor/assets/js/ vendor/assets/css/ folders, I want to just keep the entire plugin folder as is. For example,

vendor/assets/multipurpose_bookshelf_slider/

How do I make sure the paths load properly, and reference them in my manifest files?

Currently, I have some files place as follows (not exhaustive)

/my_app/vendor/assets/multipurpose_bookshelf_slider/css/skin01.css
/my_app/vendor/assets/multipurpose_bookshelf_slider/js/jquery.easing.1.3.js
/my_app/vendor/assets/multipurpose_bookshelf_slider/
/my_app/vendor/assets/multipurpose_bookshelf_slider/

I'm referencing them in

application.js

//= require multipurpose_bookshelf_slider/js/jquery.easing.1.3.js
//= require multipurpose_bookshelf_slider/js/jquery.bookshelfslider.min.js

application.css.scss

@import "css/bookshelf_slider";
@import "css/skin01";
ahnbizcad

Any folder created directly under assets will be added to the load paths. Files in that folder can be referenced as usual like so:

If you have

  • vendor/assets/custom/js/file.js

  • vendor/assets/custom/css/file.css

then vendor/assets/custom/ will be added to the load paths.

Include your files in the following files by doing the following:

application.js

//= require js/file

application.css.scss

@import "css/file";

Once that's done, make sure to restart your local server, since it is upon starting your server that the load paths get recognized.

Note: to see a list of load paths, type in your terminal rails c, then type Rails.application.config.assets.paths.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

rails 4 asset_pipeline : Include whole folder for vendor/assets

From Dev

rails 4 asset_pipeline : Include whole folder for vendor/assets

From Dev

Rails 4 asset pipeline losing vendor assets

From Dev

Add a new folder to asset path in rails 4

From Dev

Rails - How to load vendor stylesheets and javascripts into application?

From Dev

PHP failed to load vendor folder : How to install composer on my server?

From Dev

Rails 4 vendor asset images not being referenced from css files Heroku and S3

From Dev

Rails 4 vendor asset images not being referenced from css files Heroku and S3

From Dev

how to specify asset_host in rails 4?

From Dev

How to get the digest of an asset in Rails4

From Dev

Rails 4; asset helper not pointing to fingerprinted image asset (failure to load in production @ Heroku)

From Dev

Rails 4, Asset Compiling

From Dev

Rails 4 - how to reference a javascript source in vendor file

From Dev

Rails 4 - how to reference a javascript source in vendor file

From Dev

Rails 4.0. vendor/assets/javascripts - Asset Pipeline issue

From Dev

Rails / Sass: Import file from the vendor folder

From Dev

Load an asset from outside a 'resources' folder

From Dev

Load json data from local asset folder

From Dev

Static 404 page Rails 4: how to use the asset pipeline?

From Dev

How to reset Heroku Rails4 asset pipeline cache

From Dev

How to render an image in rails 4 that is not part of asset pipeline

From Dev

Rails 4: How to Use Send to Build Conditional Asset Tag Helpers

From Dev

Rails 4 with asset_sync

From Dev

multiple projects with same vendor folder on Laravel 4

From Dev

multiple projects with same vendor folder on Laravel 4

From Dev

Laravel 4 : Shows errors in vendor folder

From Dev

rails 4.1 add videos folder to asset pipeline

From Dev

What are the different purposes of the Rails asset folder paths?

From Dev

What are the different purposes of the Rails asset folder paths?

Related Related

  1. 1

    rails 4 asset_pipeline : Include whole folder for vendor/assets

  2. 2

    rails 4 asset_pipeline : Include whole folder for vendor/assets

  3. 3

    Rails 4 asset pipeline losing vendor assets

  4. 4

    Add a new folder to asset path in rails 4

  5. 5

    Rails - How to load vendor stylesheets and javascripts into application?

  6. 6

    PHP failed to load vendor folder : How to install composer on my server?

  7. 7

    Rails 4 vendor asset images not being referenced from css files Heroku and S3

  8. 8

    Rails 4 vendor asset images not being referenced from css files Heroku and S3

  9. 9

    how to specify asset_host in rails 4?

  10. 10

    How to get the digest of an asset in Rails4

  11. 11

    Rails 4; asset helper not pointing to fingerprinted image asset (failure to load in production @ Heroku)

  12. 12

    Rails 4, Asset Compiling

  13. 13

    Rails 4 - how to reference a javascript source in vendor file

  14. 14

    Rails 4 - how to reference a javascript source in vendor file

  15. 15

    Rails 4.0. vendor/assets/javascripts - Asset Pipeline issue

  16. 16

    Rails / Sass: Import file from the vendor folder

  17. 17

    Load an asset from outside a 'resources' folder

  18. 18

    Load json data from local asset folder

  19. 19

    Static 404 page Rails 4: how to use the asset pipeline?

  20. 20

    How to reset Heroku Rails4 asset pipeline cache

  21. 21

    How to render an image in rails 4 that is not part of asset pipeline

  22. 22

    Rails 4: How to Use Send to Build Conditional Asset Tag Helpers

  23. 23

    Rails 4 with asset_sync

  24. 24

    multiple projects with same vendor folder on Laravel 4

  25. 25

    multiple projects with same vendor folder on Laravel 4

  26. 26

    Laravel 4 : Shows errors in vendor folder

  27. 27

    rails 4.1 add videos folder to asset pipeline

  28. 28

    What are the different purposes of the Rails asset folder paths?

  29. 29

    What are the different purposes of the Rails asset folder paths?

HotTag

Archive