title: How to make image link to (be clickable) to page
body: <p>I am using CarrierWave and Amazon S3 to upload images to my application, which is working correctly. But I also want to have the image link to the corresponding Movie. I have tried the following but it doesn't work. I have looked but can't seem to find a solution this simple problem.</p>
  
  <pre><code>    &lt;% if @movie.avatar? %&gt;
        &lt;%= image_tag(@movie.avatar_url), link_to @movie %&gt;
      &lt;% else %&gt;
        &lt;a href="&lt;%= link_to @movie.name %&gt;"&gt;&lt;img src="http://placehold.it/150x200"&gt;&lt;/a&gt;
      &lt;% end %&gt;
  </code></pre>