Need something like erb.css

Hi!

We make Facebook-Apps.
We need something to parse css-Files. The matter on Facebook-Apps is,
that they want full paths for images. So we have to use image_path as
css attribute.

For the moment I put relevant selectors in the application.fbml.erb in
an <style> tag. But thats not an option i like.

Before i hack something by myself i want to ask if there is some kind
of solution for this.

I’m not quite sure what you are trying to do, but there’s no reason not to create a foo.css.erb file with an action that renders it and have it parse the file.

If you only change it on deployment you can also cache the action (so it generates a static file on the first call and Apache serves that).

You could also do this with Rails Metal if you want it dynamically generated but not going through the whole Rails stack.

Finally, you could look in to Sass…

Cheers,

Andy

Hey, thanks for your support.

What I want to do, are statements like:
div#main-start {width:738px;background-image: url(<%= image_path "bg-
all-start.jpg" %>);background-repeat: no-repeat;background-
color:#ecac99;height:700px;display: block;position:relative;}
in a separate css-file rather than displaying it in an <style>tag.

I think I try to render it through a controller but I wish there were
a better and cleaner possibility.

Regards,
kb

Like Andy says, check out Sass (http://sass-lang.com/)

If i make it so, I have a problem.
It includes just the http://path.css but without ?timestamp.

I have made it now like:

<%= stylesheet_link_tag stylesheet_url(:canvas => false, :what =>
Time.new.to_s) %>

But thats a request every time and not really a cache.