Rails syntax by default?


#1

I have just started using atom.

Is there a way to make atom choose HTML (Rails) or Ruby On Rails syntax over Ruby syntax by default? At the moment I have to go through each html.erb file one by one and set each one, for every project… This is tedious.

I was hoping that there would be an option similar to the one in sublime which allowed the user to set a default language for a specific file type by default but I didn’t find anything like that in atom.

So far I have tried the file-types package, and tried editing the config file. Neither of these have worked.

Is there a solution to this, or am I overlooking something simple?


#2

I have found the solution. Posting it here in case it helps anyone else who has this question.

In Atom, click Edit > Config and paste the following into the config file. Save it, then restart atom.

core:
customFileTypes:
“text.html.ruby”: [
“erb”
]


#3

There’s also a FAQ for this:


#4

Thanks for responding.

I did follow this FAQ before but for some reason it wasn’t working. I guess I must have done it wrong.

No worries I have it sorted now.