Agile Tortoise

Greg Pierce’s blog

« Large client app online      Welcome to the blogosphere, sis! »

TextMate syntax coloring and Rails 2.0

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:
  1. {   scopeName = 'text.html.ruby';
  2.     fileTypes = ( 'rhtml', 'erb' );
  3. ...

Friday, October 19th, 2007 at 8:08 am and is filed under Ruby on Rails. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

6 Responses to “TextMate syntax coloring and Rails 2.0”

  1. keithv Says:
    January 14th, 2008 at 12:34 pm

    awesome! thanks for helping me fix this niggle.

  2. Jason Says:
    January 29th, 2008 at 12:39 pm

    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’);

  3. Eric Pugh Says:
    March 23rd, 2008 at 1:19 pm

    Thanks for the tip. I’ve been slacking on fixing this annoyance and finally saw how simple it was and it worked great!

  4. TextMate and Rails 2.0 « Origin: Rails Example Applications Says:
    May 13th, 2008 at 10:27 pm

    [...] 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. [...]

  5. 6502.fr Says:
    August 4th, 2008 at 5:22 am

    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 :

  6. jmr Says:
    August 13th, 2008 at 7:50 pm

    that’s cool, but …

    now i have a new erb.icns file.
    how do i tell TextMate to use it with .erb files??

Leave a Reply