4

With Rails 3.1 I have to append my scss files with .erb to use images in my css. It's causing me a problem with textmate though.

How do you tell textmate to always open .scss.erb files as SASS?

Here's an illustration of my problem: http://screenr.com/Jjps

Lee McAlilly
  • 9,084
  • 12
  • 60
  • 94

2 Answers2

3

If you only need to .erb the sass files to include images, you can use the image-url helper provided by the sass-rails gem. This way you can keep files as .css.scss and TextMate highlighting will work.

background: #fff image-url("search.png") no-repeat scroll left center;

More info:

http://guides.rubyonrails.org/asset_pipeline.html#css-and-sass

If you have to .erb the sass files then the syntax highlighting in TextMate will only be fixed by adding support for a new language for scss.erb files in a bundle. This would be similar to the HTML (Rails) language in the popular Ruby On Rails bundle by drnic.

https://github.com/drnic/ruby-on-rails-tmbundle/tree/master/Syntaxes

chatche
  • 131
  • 3
1

Here's the official SCSS Textmate bundle:

https://github.com/kuroir/SCSS.tmbundle

Marshall Æon
  • 407
  • 1
  • 5
  • 18