views:

600

answers:

3

Hi, I have textmate 1.5.7 running on my leopard machine.

When programming in rails, for some reason some key words do not get highlighted. For example: validates_presence_of, has_many, remote_form_for (form_for gets highlighted) etc...

I tried switching themes and it did not help. I also tried upgrading to the most recent rails bundle from http://railsbundle.com/ but no cigar. Could someone please help?

Thank you very much, Yuval

+6  A: 

Use RubyOnRails as your language rather than Ruby

Omar Qureshi
thank you! this solved the problem for the code in .rb files (question about html.erb still remains open, though. see comment for Scott)
yuval
+4  A: 

If you're editing views like .erb files you'll want to select HTML (Rails) so the remote_form_for, etc. get properly highlighted. For everything else (controllers, models, migrations, etc.) like @Omar points out, make sure you've got Ruby on Rails selected.

Scott
when editing views, i am in HTML (Rails) mode. code like form_for is highlighted, it's when i add the 'remote' that it's suddenly not highlighted... is my HTML (Rails) bundle out of date? if so, where do i update it?thanks!
yuval
If you don't have it installed already, go install the "GetBundle" bundle which has an AutoUpdate bundle command. This page has a good write up on how to install GetBundle http://al3x.net/2008/12/03/how-i-use-textmate.html
Scott
i installed it, and it says the newest bundle it has for ruby on rails is from github, and is dated 2006. Most likely not rails 2.3... what to do? thank you for you help so far!
yuval
You could try uninstalling the bundle and then installing this by downloading and just double clicking on the file. TM should recognize and install the bundle for you. Says it's compatible w/ Rails 2.0http://railsbundle.com/
Scott
still didn't work - but thank you anyways. I'll mark this as the answer.
yuval
+1  A: 

Just a quick note for other lurkers -- it took me a little while to figure out how to change languages on TextMate. You can do it through the Bundle Editor, which will show you the shortcut as well...

American Yak
thanks for responding to this age old question! it's nice of you to keep other users in mind :)
yuval