-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Where to define my CSS #738
Comments
Please someone to throw some comment here please |
I am also struggling with this, I see this description in a file:
I tried creating that file, but it still is not loaded, is it related to this? |
That was a typo, should have been app/assets/stylesheets/rails_admin/custom/theming.css.scss Still, doesn't work for me. It should though, not sure why it's not picking up the files in my app/assets/stylesheets/... |
From the SASS docs:
rails_admin/imports.css.scss uses relative paths that would never hit your app if the SASS docs are to be taken seriously. |
Noticed that rails_admin/rails_admin.css is using sprockets to require rails_admin/imports.css.scss.erb. Therefore, if you also copy rails_admin/imports.css.scss, sprockets will pick up your imports.css.scss.erb first, which will then look in the current directory before the rails_admin directory. This is definitely a work-around, not sure what the real solution is. Using sprockets in custom/*.css.scss? |
I'm also having this problem. Copying the rails_admin/imports.css.scss.erb file is working for me, but does feel like a hack. |
Weird. It worked when I added the feature (it was picking app's file before the dummy RailsAdmin one). Anyone with an idea for a fix? |
Do we have a solution for this? It's definitely not working for me... But I should say that overring ui.js has been working beautifully for my javascript. |
For those that found a workaround, what exactly did you do? |
I'm also struggling with this. Let us know if you've found a workaround! |
tmp/cache delete to the rescue! I was having the same issue, and then I gave the:
a shot and all is well :) |
so any answer to this? |
Based on @Tuckie's comment it looks as if this was a cache issue. If not, please re-open. |
I had to copy over rails_admin/rails_admin.js and add it to precompile, then everything worked. Same procedure with rails_admin/rails_admin.scss.erb (add the compiled name to precompile += %w{rails_admin/rails_admin.css}). |
This is not working at all. I've tried everything I can to get this to work, and it doesn't seem to want to use my rails_admin/custom/theming.css.scss (or theming.scss) file. I've deleted tmp/cache, recompiled my assets, edited the manifest file, everything. Can someone give me a simple example of how to override theming.scss? |
It works for me on my local machine, but it still serves the old assets on Heroku. Anyone found a fix yet? |
I also had some problems with old assets being served. After I stumbled over rails/sprockets-rails#95 I realized that I have to create non digest assets for some ckeditor resources, because sprockets is not always able to update referencing digests as expected. I use the following rake task todo so: # based on https://gist.github.com/markbao/6431880
require 'fileutils'
desc "Create nondigest versions of all ckeditor digest assets"
task "assets:precompile" => :environment do
fingerprint = /\-([0-9a-f]{32})\./
#for file in Dir["public/assets/ckeditor/**/*"]
for file in Dir['public/assets/ckeditor/skins/moono/*.png', 'public/assets/ckeditor/config-*.js', 'public/assets/ckeditor/config-*.js.gz']
# Skip file unless it has a fingerprint
next unless file =~ fingerprint
# Get filename of this file without the digest
# (example) public/assets/ckeditor/config.js
nondigest = file.sub fingerprint, '.'
# Create a filename relative to public/assets
# (example) public/assets/ckeditor/config.js => ckeditor/config.js
filename = nondigest.sub 'public/assets/', ''
filename = filename.sub /.gz$/, '' # Remove .gz for correct asset checking
# Fetch the latest digest for this file from assets
latest_digest = Rails.application.assets.find_asset(filename).digest
# Compare digest of this file to latest digest
# [1] is the enclosed capture in the fingerprint regex above
this_digest = file.match(fingerprint)[1]
if (this_digest == latest_digest)
# This file's digest matches latest digest, copy
#puts 'Matching digest, copying ' + file
FileUtils.cp file, nondigest, verbose: true
else
# This file's digest doesn't match latest digest, ignore
puts 'Non-matching digests, use latest digest to create ' + nondigest
puts 'Latest digest: ' + latest_digest
puts 'This digest: ' + this_digest
#puts 'Non-matching digest, not copying ' + file
FileUtils.cp "public/assets/#{Rails.application.assets.find_asset(filename).digest_path}", nondigest, verbose: true
end
end
end This rake task is executed after each assets:precompile, hence the new files will be in the heroku slug, and are not deleted after e.g. a dyno restart. |
Having the same problem as @aomahony. This is on a development machine, so there shouldn't be any asset precompiling anyway. I did delete my tmp/cache folder just to be safe, but still no difference. This is on Rails 4.0 with RA 0.6.0. |
Restarting the server seemed to do the trick on development. Fingers crossed that it works on production/staging. |
Nope, does not work in my staging environment on Heroku :( If I precompile it locally, I can see the custom CSS is added to the rails_admin.css file, but this doesn't seem to work on Heroku using it's deploy-time asset precompiling. I'd rather not have to rely on precompiling locally before each deploy. |
Anyone found a fix? I've tried everything but it still doesnt work on staging/production on Heroku. Works on local dev environment. Please help, thanks! |
+1 @chrisbloom7 restarting the server did the trick for me too. |
Nothing in this thread worked for me. Problem was, I was following the following instructions, as found in
What worked: ignoring these instructions, overwriting |
Here is what worked for me: I copied default theme from rails admin gem In That worked for development but i couldn't force heroku to recompile Changing asset version in Hope it helps someone |
So, I had the same problem and discovered that yes, for me it was a caching problem as well. I just didn't restart the server and cleared the tmp/cache and precompiled assets at the same time. In the process of discovering this I created a minimal testing app: https://github.com/KonstantinKo/rails_admin_issue_738_test Since people still seem to have this issue: |
ive followed dmilisic configuration, Rails.application.config.assets.version = '1.1' |
Clearing tmp/cache and restarting the server worked for me as well. This really should be in the docs. |
In readme "Fields - Column CSS class"
where I should define customClass, except the hook:
The text was updated successfully, but these errors were encountered: