Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/58.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 更正整个应用程序上的旧路径_Css_Ruby On Rails_Regex_Asset Pipeline_Replace - Fatal编程技术网

Css 更正整个应用程序上的旧路径

Css 更正整个应用程序上的旧路径,css,ruby-on-rails,regex,asset-pipeline,replace,Css,Ruby On Rails,Regex,Asset Pipeline,Replace,我刚刚在管道中更新了一个过时的应用程序,我的css路径中有90%是用软管冲洗的。旧路径是:/images/scrollers/comming_left.png新路径是/assets/scrollers/comming_left.png 简单地说,第一个/图像需要成为整个应用程序中的/资产 我正在考虑对整个样式表目录进行查找和替换,以获取/images并将其更改为/assets 问题是,我只想替换启动/images的路径,而不是像/assets/images/foobar.png这样的路径 我的正

我刚刚在管道中更新了一个过时的应用程序,我的css路径中有90%是用软管冲洗的。旧路径是:/images/scrollers/comming_left.png新路径是/assets/scrollers/comming_left.png

简单地说,第一个/图像需要成为整个应用程序中的/资产

我正在考虑对整个样式表目录进行查找和替换,以获取/images并将其更改为/assets

问题是,我只想替换启动/images的路径,而不是像/assets/images/foobar.png这样的路径


我的正则表达式技能是缺乏的,但我很确定有一个干燥剂解决这个问题。我正在运行rails 3.2、ruby 1.9.3和sublime text 2…非常感谢您的帮助

你不能在
(“/images
”)上做一个精细的替换吗?我猜你所有的css路径都类似于
url(“/images/…”)
,你可以试试
\B/images
?我在看到你的回复之前就这样做了。我在样式表目录中搜索了三个查找和替换,1.url(“/images/“”)2.url(“/images/”)3.url(/images/)--相当粗略的提交;-)