Reputation: 319
I have a Rails app that uses slim for templating. I'd like to have:
javascript: window.ads.hasMap = ??? # value of show_map
like in .erb
window.ads.hasMap = <%=show_map %>;
How would I do this?
Upvotes: 0
Views: 167
Reputation: 1309
According to the docs, it looks like you want:
javascript: window.ads.hasMap = #{show_map}
That is, wrap your ruby variable or method in #{...}.
#{...}
Upvotes: 1