def growlyflash_static_notices(js_var = 'window.flashes')
      return if flash.empty?
      script = "#{js_var} = #{growlyhash.to_json.html_safe};".freeze
      view_context.javascript_tag(script, defer: 'defer')
    end
def growlyflash_static_notices(js_var = 'window.flashes')
      return if flash.empty?
      script = "#{js_var} = #{growlyhash.to_json.html_safe};".freeze
      view_context.javascript_tag(script, defer: 'defer')
    end
View helper method which renders flash messages to js variable if they
 weren't dumped to headers with XHR request