On Rails 3 I got into the habit of keeping a separate admin stylesheet (app/assets/stylesheets/admin.css), incorporating bootstrap/foundation and then in production.rb I'd have something like:
# in config/production.erb
config.assets.precompile += ( admin.css )
I could then run:
RAILS_ENV=production bundle exec rake assets:precompile
And this would generate admin.css and admin.css.gz.
But this seems to be broken in Rails 4.0.0.beta1. It might be a sprockets issue, so pardon me if that's the case.
Now, no matter what I put in my admin.css file, and no matter what I add to production.rb
the admin stylesheet is never precompiled.
Rails 4 example app
Rails 3 example app
Steps to reproduce:
- Clone sample apps
bundle install
NB: sample apps were used to report another issue, so there is a bit of left-over detritus in there, just ignore it
- Starting with the Rails 4 example app, run:
RAILS_ENV=production bundle exec rake assets:precompile
- Inspect public/assets
- Observe that the admin stylesheet has not been precompiled
- Repeat steps 2 and 3 using Rails 3 sample app
- Observe that admin stylesheet has been precompiled
For now I'm getting round this by lobbing everything into my application.css
This happens with js assets too.
On Rails 3 I got into the habit of keeping a separate admin stylesheet (app/assets/stylesheets/admin.css), incorporating bootstrap/foundation and then in production.rb I'd have something like:
I could then run:
And this would generate admin.css and admin.css.gz.
But this seems to be broken in Rails 4.0.0.beta1. It might be a sprockets issue, so pardon me if that's the case.
Now, no matter what I put in my admin.css file, and no matter what I add to production.rb
the admin stylesheet is never precompiled.
Rails 4 example app
Rails 3 example app
Steps to reproduce:
bundle installNB: sample apps were used to report another issue, so there is a bit of left-over detritus in there, just ignore it
RAILS_ENV=production bundle exec rake assets:precompile
For now I'm getting round this by lobbing everything into my application.css
This happens with js assets too.