Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6569557
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:38:46+00:00 2026-05-25T14:38:46+00:00

My .css.erb file uses the asset_path helper to add image urls like so: background:

  • 0

My .css.erb file uses the asset_path helper to add image urls like so:

background: url(<%= asset_path(‘bg_image.gif’) %>);

I would expect the asset_path helper to append a md5 fingerprint, like it does in the view files when doing rake assets:precompile. But in the compiled css the url simply becomes:

background: url(/assets/bg_image.gif)

That way loading of images referenced from css works but is slow. I’d like the css to used the fingerprinted versions obviously.

Anybody know what the issue is? Maybe I need to file a bug with rails.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T14:38:47+00:00Added an answer on May 25, 2026 at 2:38 pm

    Okay, I recompiled my assets with bundle exec rake assets:precompile RAILS_ENV=production and it works now!

    I used to simply do rake assets:precompile locally, as I read that precompile uses the production environment as a default. However, that doesn’t seem to be the case.

    (I have to precompile locally as I’m on Heroku)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an .erb file with form template that uses form_for helper to generate
CSS code body { background-attachment: scroll; background-clip: border-box; background-color: #ececec; background-image: none; background-origin: padding-box;
I am trying to make a URL like <a href=/formats/formats.html.erb>Link Title</a> from within my
In my global.css file which is loaded by application.html.erb , I have the following
Is there any way to suppress the default js and css loaded by application.html.erb
Do CSS colors render differently on different monitors? Most importantly, will tools like Digital
In my app I have the follow line <%= stylesheet_link_tag global.css, pop_div.css, log_in.css.erb %>
I have this file: app/views/listings/list.html.erb in my rails project. Here are the contents of
Suppose I had a file fonts.css.scss with the following: @font-face { font-family: 'Play'; font-style:
I am using Ruby on Rails and I would like to ensure that my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.