0

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 but no cigar. Could someone please help?

user229044
  • 232,980
  • 40
  • 330
  • 338
Yuval Karmi
  • 26,277
  • 39
  • 124
  • 175

3 Answers3

7

Use RubyOnRails as your language rather than Ruby

Omar Qureshi
  • 8,963
  • 3
  • 33
  • 35
  • 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 Karmi Jun 24 '09 at 16:44
4

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
  • 654
  • 5
  • 10
  • 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 Karmi Jun 24 '09 at 16:45
  • 1
    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 Jun 24 '09 at 17:21
  • 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 Karmi Jun 26 '09 at 07:46
  • 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.0 http://railsbundle.com/ – Scott Jun 26 '09 at 14:47
  • still didn't work - but thank you anyways. I'll mark this as the answer. – Yuval Karmi Jul 12 '09 at 22:30
1

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

arxpoetica
  • 4,841
  • 3
  • 30
  • 35