Correct Syntax Highlighting for Embedded Ruby in HAML?

Hi everyone,

i was wondering if there is any way to get the syntax highlighting to work for .haml-files whith embedded ruby. This does not work correctly under Rubymine 5.4.3.2.1.
Example line:

%td= @<%= singular_table_name %>.<%= attribute.name %>


Thanks for any help

4 comments

Hi,

it looks like you use HAML and ERB if so make the file .haml.erb and everything should work.

Regards, Oleg.

0

Thanks for the answer. I could do that, but then the file does not get used by the rails scaffold generator (it is a custom scaffold template), so i would have to rename that file constantly from .haml to .haml.erb and back.
Isn't there some possibility to tell Rubymine to treat .haml-files with embedded ruby the same way as .haml.erb (or even to autodetect if embedded ruby is present and treat the file accordingly)?

0

Nope, there is no way to do this :(
But why do you need haml+erb if haml itself support ruby injection?

Regards, Oleg.

0

Because it is a .haml-template for rails generate scaffold. This file is just a template from which the generator generates the actual .haml-file und thus can not evaluate standard .haml ruby injection, but instead must only evaluate embedded-ruby.

0

Please sign in to leave a comment.