How do I include inline JavaScript in Haml?

Fuego DeBassi picture Fuego DeBassi · Mar 16, 2012 · Viewed 105.7k times · Source

How can I write something like this to include in a template, but in Haml?

<script>
$(document).ready( function() {
  $('body').addClass( 'test' );
} );
</script>

Answer

bcoughlan picture bcoughlan · Mar 16, 2012
:javascript
    $(document).ready( function() {
      $('body').addClass( 'test' );
    } );

Docs: http://haml.info/docs/yardoc/file.REFERENCE.html#javascript-filter