title: Invalid flags supplied to RegExp constructor in js.erb file
body: <p>I'm trying to changes the <code>src</code> attribute of my img(s) when they are hovered over using jQuery. But I am getting an error saying ,<code>Uncaught SyntaxError: Invalid flags supplied to RegExp constructor 'icon_history'</code> </p>
  
  <p>app.js.erb</p>
  
  <pre><code> var hover = &lt;%= image_path 'icon_history-h1' %&gt;;
  
    var unhover = &lt;%= image_path 'icon_history' %&gt;;
  
    $('img.more').hover(function(){
      console.log(hover);
      $(this).attr('src', hover);
    },
    function(){
      console.log(unhover);
      $(this).attr('src', unhover);
    });
  </code></pre>