Q:

How to specify format when calling haml templates in Sinatra

In Sinatra, the following code
haml :index

Will render the file index.html.haml or index.haml
How can I specify file format? I been reading Sinatra README and trying different combinations but I can't see how to do it. 
I need to be able to specify a haml template by giving its format too so I can do something like  index.js.haml.

A:

As @Kashyap points out
haml :'index.js'

That would do the trick.

