Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rails config.assets.precompile for specific sub folder

Ive some very heavy external stylesheets in app/assets/stylesheets/external/calendars I dont want to include the stylesheets into the application.css as they are used infrequently

Yet i want them precompiled.

Ho w do i use config.assets.precompile o selectively precompile all stylesheets nside this folder ?

like image 495
Mohith Thimmaiah Avatar asked Oct 21 '12 19:10

Mohith Thimmaiah


2 Answers

You can simple write it like this:

config.assets.precompile += ['directory1/*', 'directory2/*', 'file.js']

Or use a cleaner syntax like this:

config.assets.precompile += %w( directory1/* directory2/* file.js )
like image 193
Flavio Wuensche Avatar answered Nov 15 '22 21:11

Flavio Wuensche


This is covered in section 4.1 of the Asset Pipeline Rails Guide

config.assets.precompile += ["*external/calendars*"]
like image 31
doesterr Avatar answered Nov 15 '22 22:11

doesterr