This is the code I currently have:
:javascript
// do something
- if current_user.role? :client
:javascript
//do something else
It's obviously not very clean since I'm repeating the :javascript haml filter. I'd like to avoid that, but I don't know how to properly write a Ruby "if" statement inside a HAML :javascript block.
I know how to interpolate variables with #{}, but how do you do the same for whole if/for/etc. statements?