Last active
August 29, 2015 14:02
-
-
Save between40and2/ee9c64da8c18a2a5f47b to your computer and use it in GitHub Desktop.
Rails Assets Pipeline Tips
Guides suggests us to bundle design assets into a plugin/engine. But it does not tell us clearly how to import it in hosting app.
assets.prepend_path '../../../zn/rails/zn_site/app/assets/stylesheets'
puts "assets.path : #{assets.paths}"
*= require 'site-footer'
*= require_directory '../../../../../../zn/rails/zn_site/app/assets/stylesheets/zn_site'
Note that require_directory
and require_tree
only take relative path (from application.css not other places like host root)
See in source code
The reason that application.js
is chosen, is because your layout says so. In your typical layout view, you will see something like
stylesheet_link_tag 'application'
which (stylesheet_link_tag) is defined in ActionView::Helpers::AssetTagHelper
You are free to add more lines like this to include other css files. :-)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment