Now that the Ruby on Rails 2.0 Preview Release is out, I'm playing around with it. First thing I noticed, while minor, is that TextMate's syntax coloring for "HTML (Rails)" doesn't recognize the new view naming scheme. "rhtml" is now replaced by "html.erb" as the file extension.
It's a simple fix, however. Just open up the Bundle Editor, go to the "Rails" bundle, then the "HTML (Rails)" language definition, and add 'erb' to the filetypes array on the second line. Like:
JavaScript:
-
{ scopeName = 'text.html.ruby';
-
fileTypes = ( 'rhtml', 'erb' );
-
...
awesome! thanks for helping me fix this niggle.
Weird, It only works on the layouts folder, but when I’ve added it on the HTML bundle, it works
just add ‘html.erb’ on the fileTypes:
e.g.
fileTypes = ( ‘html’, ‘htm’, ’shtml’, ‘xhtml’, ‘phtml’, ‘php’, ‘inc’, ‘tmpl’, ‘tpl’, ‘html.erb’);
Thanks for the tip. I’ve been slacking on fixing this annoyance and finally saw how simple it was and it worked great!
[...] What to do? A few people have suggested tweaks using TextMate’s Bundle Editor (here and here). A better option is the new TextMate Rails 2.0 bundle now under development by Dr Nic Williams. [...]
Coloration syntaxique des fichiers .html.erb dans TextMate…
TextMate Version 1.5.7 (1436) ne reconnaît pas l’extension .html.erb dans le bundle Ruby on Rails. Pour l’ajouter, ouvrir le Bundle Editor, filtrer par Langage, et sélectionner HTML (Rails) sous Ruby on Rails. Ajouter l’extension :
…
that’s cool, but …
now i have a new erb.icns file.
how do i tell TextMate to use it with .erb files??
You are the MAN, Greg!