rails 4 asset_pipeline : Include whole folder for vendor/assets

fneron

The whole point of this is to include a template from wrap bootstrap. I have been playing around with it, but would it be possible to include a folder to our rails application.css or application.js in app/assets (or even images).

I have put my files from my template under

  • vendor/assets/stylesheets/mytemplate/allmycssstuff
  • vendor/assets/javascripts/mytemplate/allmyjavascriptsstuff
  • vendor/assets/fonts/mytemplate/allmyfontsstuff
  • vendor/assets/images/mytemplate/allmyimagesstuff

For now, I basically require each one and it works, but it's a long process (since sometime templates have plugins). Is it possible to require a folder, so it fetch every file with *.css extension?

So, I would do something like (in app/assets/stylsheets/application.css):

*= require mytemplate/*.css (doesn't work)

And same for others...

Alexa Y

You can use the require_tree directive in the application.css and application.js manifest files, which will recursively include any files in the given directories. These are relative paths however, so you'll need something like this:

 *= require_tree ../../../vendor/assets/stylesheets

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 asset pipeline: Can it be good practice to include asset in public folder instead of asset folder?

From Dev

Add a new folder to asset path in rails 4

From Dev

How to load vendor asset folder in Rails 4?

From Dev

rails 4.1 add videos folder to asset pipeline

From Dev

rails 4 asset pipeline image subdirectories

From Dev

Rails 4 asset pipeline losing vendor assets

From Dev

Syntax of IF statement Rails 4 with Asset Pipeline

From Dev

Rails 4 include and select

From Dev

Rails 4 include and select

From Dev

Include custom folder specific assets in ruby on rails

From Dev

Rails 4 Asset Pipeline: Asset missing fingerprint in asset_path from js

From Dev

What are best practices organizing css for the Asset Pipeline in Rails 4

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

rails 4 asset pipeline assets.rb refactor issue

From Dev

Rails 4 Asset Pipeline: Compile both with and without fingerprint

From Dev

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

From Dev

Prevent Rails 4 Sprocket Asset Pipeline from caching a specific file

From Dev

Rails 4 Heroku Assets not loading, though in heroku asset pipeline

From Dev

Rails 4: Grouping Controllers in a folder

From Dev

Create/Include a modell for the whole controller in Codeigniter4

From Dev

Javascript asset pipeline: 404 error - How to include Google analytics code in Rails?

From Dev

Rails 4 asset pipeline doesn't overwrite assets with asset_path references to other assets

From Dev

Rails 4, Asset Compiling

From Dev

How to include page specific javascript in rails 4

From Dev

Rails 4 - Don't include self in variable

From Dev

Rails 4 respond_with include association with WHERE

From Dev

Rails 4 to_json include all associations

Related Related

  1. 1

    rails 4 asset_pipeline : Include whole folder for vendor/assets

  2. 2

    Rails asset pipeline: Can it be good practice to include asset in public folder instead of asset folder?

  3. 3

    Add a new folder to asset path in rails 4

  4. 4

    How to load vendor asset folder in Rails 4?

  5. 5

    rails 4.1 add videos folder to asset pipeline

  6. 6

    rails 4 asset pipeline image subdirectories

  7. 7

    Rails 4 asset pipeline losing vendor assets

  8. 8

    Syntax of IF statement Rails 4 with Asset Pipeline

  9. 9

    Rails 4 include and select

  10. 10

    Rails 4 include and select

  11. 11

    Include custom folder specific assets in ruby on rails

  12. 12

    Rails 4 Asset Pipeline: Asset missing fingerprint in asset_path from js

  13. 13

    What are best practices organizing css for the Asset Pipeline in Rails 4

  14. 14

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

  15. 15

    How to reset Heroku Rails4 asset pipeline cache

  16. 16

    rails 4 asset pipeline assets.rb refactor issue

  17. 17

    Rails 4 Asset Pipeline: Compile both with and without fingerprint

  18. 18

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

  19. 19

    Prevent Rails 4 Sprocket Asset Pipeline from caching a specific file

  20. 20

    Rails 4 Heroku Assets not loading, though in heroku asset pipeline

  21. 21

    Rails 4: Grouping Controllers in a folder

  22. 22

    Create/Include a modell for the whole controller in Codeigniter4

  23. 23

    Javascript asset pipeline: 404 error - How to include Google analytics code in Rails?

  24. 24

    Rails 4 asset pipeline doesn't overwrite assets with asset_path references to other assets

  25. 25

    Rails 4, Asset Compiling

  26. 26

    How to include page specific javascript in rails 4

  27. 27

    Rails 4 - Don't include self in variable

  28. 28

    Rails 4 respond_with include association with WHERE

  29. 29

    Rails 4 to_json include all associations

HotTag

Archive