title: Use JQuery for change a image in Ruby on Rails
body: <p>I'm having problems to change an image using JQuery. </p>
  
  <p>The fragment from my <code>hmtl.erb</code>:</p>
  
  <pre><code>&lt;%= image_tag('empty-screen.png', style:'width: 100%', class:'img-responsive center-block', id:'screen-d') %&gt;
  </code></pre>
  
  <p>Fragment from my <code>javascript</code>:</p>
  
  <pre><code>$("#collapseOne").on('show.bs.collapse',function () {
          $('#screen-d').attr("src","#{asset_path('empty-screen.png')}");
      });
  </code></pre>
  
  <p>The real problem is that I don't know very well how Rails uses the asset pipeline. I believed that using <code>asset_path</code> would work, but with that code I was just changing the <code>src</code> to <code>#{asset_path('empty-screen.png')}</code>. So I don't really know what to do.</p>