【发布时间】:2011-09-14 19:31:35
【问题描述】:
在 Rails 3.1 中,我必须在我的 scss 文件中附加 .erb 才能在我的 css 中使用图像。不过,这给我带来了 textmate 的问题。
如何告诉 textmate 始终以 SASS 形式打开 .scss.erb 文件?
这是我的问题的说明: http://screenr.com/Jjps
【问题讨论】:
标签: textmate ruby-on-rails-3.1 textmatebundles
在 Rails 3.1 中,我必须在我的 scss 文件中附加 .erb 才能在我的 css 中使用图像。不过,这给我带来了 textmate 的问题。
如何告诉 textmate 始终以 SASS 形式打开 .scss.erb 文件?
这是我的问题的说明: http://screenr.com/Jjps
【问题讨论】:
标签: textmate ruby-on-rails-3.1 textmatebundles
如果你只需要 .erb sass 文件来包含图像,你可以使用 sass-rails gem 提供的 image-url 帮助器。这样您就可以将文件保留为 .css.scss 和 TextMate 突出显示。
background: #fff image-url("search.png") no-repeat scroll left center;
更多信息:
http://guides.rubyonrails.org/asset_pipeline.html#css-and-sass
如果您必须对 sass 文件进行 .erb 处理,则 TextMate 中的语法突出显示只能通过在捆绑包中添加对 scss.erb 文件的新语言的支持来修复。这类似于 drnic 流行的 Ruby On Rails 包中的 HTML (Rails) 语言。
https://github.com/drnic/ruby-on-rails-tmbundle/tree/master/Syntaxes
【讨论】:
这是官方的 SCSS Textmate 包:
【讨论】: