1

In my Ruby on Rails templates I write underscore templates within <script type='text/html'> elements.

I'm using rails.vim and other plugins, but syntax highlighting and identation rules don't work for the htmls inside these elements.

0

1 Answer 1

3

Put it in a partial. That also keeps the page with all the html scripts from growing into a monster.

<script type="text/x-underscore">
  <%= render 'my_partial_with_syntax_highlighting' %>
</script>

Ditto for using something other than text/html for content type.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.