Inside of a view in my rails app. I am trying to detect the screen size using JavaScript and render some rails content depending on the screen size.
Here is what I have:
<script>
if( $(window).width() < 1000){
'<%= @resize = true %>';
} else {
'<%= @resize = false %>';
}
</script>
I keep getting false returned for the @resize variable even if the browser window size is less than 1000. How would I go about getting this to work?