Specify options for a filter in ruby HAML
Is there any way to add options (HTML attributes) to HAML filters? I wanted to do something like this : :javascript{:'data-turbolinks-eval' => 'false', :foo => 'bar'} if(someCondition){ doSomething(); } And the result would be : <script 'data-turbolinks-eval'='false' 'foo'='bar'> if(someCondition){ doSomething(); } </script> The closest I could get is : %script{:'data-turbolinks-eval' => 'false', :foo => 'bar'} if(someCondition){ doSomething(); } The drawback is that you can't indent your JS in HAML unless you're using the :javascript filter. It's ok for a few lines, but it can get messy