keeping things simple (hopefully)
December 12, 2007
Filed under: Rails — Jason @ 6:31 pm

In order to get proper syntax highlighting for the new Rails 2 naming conventions of templates (html.erb) in Textmate, just fire up Textmate and go into the bundle editor and make the changes as follows:

Textmate > Bundles > Bundle Editor > Show Bundle (or just hit ctrl-opt-cmd B)


Select Languages in the drop down menu


Go to Ruby on Rails > HTML (Rails)

On the second line just change the code from:

fileTypes = ( 'rhtml');


fileTypes = ( 'rhtml', 'erb' ); #For backwards compatability

and you should be good to go…

P.S. here’s a link to a code snippet that will allow you to change all of your rhtml file extensions to html.erb (warning: I have not yet tested this so use at your own risk)