views:

120

answers:

3

Hi,

I am editing a .html.erb file with HTML(rails) selected at the bottom. When I type if I get:

< ?php if (condition): ? >

< ?php endif ? >

Any ideas?

Cheers

A: 

Don't fully understand but when I type: if and hit TAB, I get PHP instead:

<?php if (condition): ?>
<?php endif ?>

You could create your own ERB snippet for example on IF, TAB:

<% if ${1:value?} %>
  ${2}
<% end %>
benvds
The reason you guys are seeing this is because the scope selector for the "PHP if" snippet is "text.html". If there isn't a more specific selector matched first, you'll end up executing this one when you type "if[tab]".
jdl
A: 

Suggestion: Open your Bundle Editor and delete the PHP bundle in you don't need it. This way, I won't interfere with your ERB templates again.

Christoph Schiessl
A: 

You probably have an incorrect manual binding for .erb files. To see what manual bindings you have run

defaults read com.macromates.textmate OakLanguageFileBindings

If you want to get rid of all your manual bindings, quit TextMate and run

defaults delete com.macromates.textmate OakLanguageFileBindings

More info here http://blog.macromates.com/2007/file-type-detection-rspec-rails/

tjstankus