Jump to content

The ultimate community for Ruby on Rails developers.


Compiling best practices

  • Please log in to reply
1 reply to this topic

#1 nicklombardi



  • Members
  • 2 posts

Posted 10 September 2013 - 02:28 PM

Are there any obvious precompiling best practices? Inevitably, I always hit errors deploying which are normally fixed by arbitrarily reordering the order in which my assets are compiled. Are there any good resources on this topic?

#2 Rowel



  • Members
  • 109 posts

Posted 10 September 2013 - 03:42 PM

Hi nick, your post reminded me of a trouble I had with heroku during app deployment.

I checked my notes and this is what I wrote: 

!!! Problem:  bootstrap responsive is included first in the compiled .css code at Heroku. So responsive feature not working when app is deployed. 
!!!! FIX: do not use 'require_tree', instead explicitly include all the css files you need in the order you want
Remove require_tree directive in application.css, so you'll have better control of the order of css files being imported in. 

Now, whether that is best practice, I don't know. :) still a beginner here.  But that definitely fixed my problems with ordering. (It's mostly irritating with CSS files.  With Javascript and other assets, it's inconsequential.  )

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users