Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

image-url() instead of url() in production #25

Closed
factor4 opened this issue Apr 27, 2012 · 5 comments
Closed

image-url() instead of url() in production #25

factor4 opened this issue Apr 27, 2012 · 5 comments
Labels

Comments

@factor4
Copy link

factor4 commented Apr 27, 2012

Hello!

First of all, thank you for this great gem! :)

But I have one strange issue:

Rails 3.2.3
Roadie 2.3.1

In production the mail contain style Tags with background:image-url(http...) instead of background:url(http...)

In development everything works fine.

The precompiled CSS file contains the correct background definition generated from SCSS .header{background:url(/assets...);}

I tried both techniques to include the CSS. A HTML Tag in the head and the :css option. The same problem with both.

Any ideas what this could be?

@Mange
Copy link
Owner

Mange commented Apr 27, 2012

Double check your file extensions. I had that issue once when I named the file foo.css.css instead of foo.css.scss.

@factor4
Copy link
Author

factor4 commented Apr 28, 2012

The file extension is correct: email.css.scss

Does Roadie read the CSS from the SCSS file or from the precompiled CSS file? My precompiled file /assets/email.css have the correct CSS background:url(/assets...)

@Mange
Copy link
Owner

Mange commented Apr 28, 2012

By default, in Rails 3.1 and 3.2, Roadie will use files from the asset pipeline if it's enabled, otherwise it will use the file system.

I'm guessing that it's using the filesystem instead of the pipeline in your case. Are you using the :css option in the mailer or are you letting Roadie inline <link rel="stylesheet"> elements?

:css option is the recommended one since it's easier to get it right. I want to address these difficulties in a later version, but I'm still not sure how.

@factor4
Copy link
Author

factor4 commented Apr 30, 2012

I solved my problem but I don´t know what exactly happen.

I precompiled my assets on my local machine an deployed it to the production server. That seems not to work or I forgot to precompile it after a change. Once I run rake assets:precompile on the production Server everything works as it should.

Sorry for the inconvenience!

@factor4 factor4 closed this as completed Apr 30, 2012
@Mange
Copy link
Owner

Mange commented Apr 30, 2012

No problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants