Sublime Forum

Problem recognizing the <% %> for ruby on sublime

#1

Hello,

I’m new to coding and just installed sublime text, however it doesn’t seem to recognize the tags for ruby: <% %> thus the app doesn’t understand that it is ruby.

example:
<%= form_for @post do |f| %>
[…]
<% end%>
sublime doesnt recognize the tags and the @post demand
I am using rails 5.0.1 and ruby 2.2.4

Any help would be very appreciated!

0 Likes

#2

if you are creating a new file that hasn’t been saved yet, you may have to tell ST what syntax highlighting to use:

View menu -> Syntax -> Ruby

0 Likes

#3

Thanks for answering,

The syntax is HTML(rails) as it is a rails application

0 Likes

#4

I’m guessing your color scheme just doesn’t color these parts of the syntax. Try installing https://packagecontrol.io/packages/Boxy%20Theme and activating one of it’s color schemes.

0 Likes

#5

Thanks again, I tried installing Boxy theme and Bracket highlighter, but none of them seem to work…
It seems as thought sublime doesn’t recognize the <% %> tags in a HTML(rails), .html.erb file, the same thing happens when I use another editor (Brackets)

Any other ideas?

0 Likes

#6

it’s weird because your HTML (Rails) example works for me:

0 Likes

#7

Yeah exactly, It works on some of my friends laptop, just not mine…

I’ve tried reinstalling sublime text2, tried updating ruby and rails, im a bit lost

0 Likes

#8

oh, is there a reason why you are using ST2 and not ST3? it might be related, ST2 is quite old now.

0 Likes

#9

I downloaded Sublime 3126, installed package control and boxy theme, and it works now!

Thank you so much for your help!

0 Likes