Right now, Textmate uses .erb for this, which means it treats it like a html editor
When i click on the option below to change it, ALL views (.html.erb) are changed to javascript edi开发者_运维知识库ting
How do i change it to javascript just for the file type .js.erb?
This article describes the method that TextMate uses to determine file type:
http://blog.macromates.com/2007/file-type-detection-rspec-rails/
In my setup js.erb files are automatically picked up as JavaScript (Rails) file type. Try opening up the Bundle Editor and navigate to the language definition for "JavaScript (Rails)", you should see a line in there defining file types:
fileTypes = ( 'js.erb' );
If 'js.erb' is not there then try adding it.
I don't remember having to do this manually myself but a quick test confirms that it does control the file type mapping for this kind of file.
精彩评论