javascript:
var flash_message = '';
- if flash.any?
$(document).ready(function(){
$(".button-collapse").sideNav();
});
I want use normal erb tag in javascript area generate by slim. If have flash message, set flash_message = html string generate by rails helper. But I can't use - if flash.any? in javascript: of slim.
Use Text interpolation:
var flash_message = '#{flash.any? ? flash_to_html_helper(flash) : nil}';