开发者

From db to css file?

I have a small set of css items in a db table that I need to turn into a css file to be included on a page. How can I do this in Rails3?

Is there a way I can call this directly from a stylesheet_link tag? Do I need to go through some ruby to open a file and output it in some directory first? Do I do this in a controller?

The css is actually its own model associated to the item using the css.

I do not know and looking for a solution found little yet, so asking here.

EDIT:

Simple when looked at, I was looking toward a sass or less solution and may still, but this is a s开发者_运维问答imple start


I would create a Controller that retrieves the data from the database that uses a View to render the data to a Cascading Style Sheet.

You could then reference the given URL whenever you need to use the resulting stylesheet.


This is the easiest way that I have found http://blog.hasmanythrough.com/2007/10/18/simpler-than-dirt-restful-dynamic-css

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜