I am trying to implement jqvmap and have multiple regions selected and colored. How do I pass a variable from Rails into this javascript so that the 'selectedRegions' variable will work? I've tried endlessly but can't seem to make the JS read the variable correctly.
JS code:
<script type="text/javascript">
jQuery(document).ready(function() {
var areas1=['CA','US'];
jQuery('#vmap').vectorMap({
map: 'world_en',
selectedColor: '#FFC864',
selectedRegions: areas1
});
});
</script>
The selectedRegions variable needs take in format: ['CA', 'US'], but when I pass in this format from my Rails helper method, it does not work. Any JS experts out there with some thoughts would be greatly appreciated!