title: Thumbnail image (used Carrierwave + minimagick) shows up in show.html.erb but not in index.html.er)
body: <p>When I insert the image tag (below) in "show.html.erb"</p>
  
  <pre><code>&lt;%= image_tag @lecture.thumbnail_url(:thumb) %&gt;
  </code></pre>
  
  <p>the thumbnail does show up in my localhost:3000.</p>
  
  <p>But, when I insert the same image tag in my "index.html.erb", which I am trying to do, the image (thumbnail) does not show up. Instead, I get an error message that says</p>
  
  <p>NoMethodError in Lectures#index</p>
  
  <p>Showing /Users/joebcvan/workspace/aca/app/views/lectures/index.html.erb where line #15 raised:</p>
  
  <p>undefined method `thumbnail_url' for nil:NilClass</p>
  
  <p>And the error message directly points the error to the image tag line.</p>
  
  <p>I have tried inserting the image tag everywhere in the index.html.erb (out of my div tag etc..) But, the image still does not show up - It just doesn't work in the index.html.erb. I have tried playing around with the app/uploaders/thumbnail_uploader.rb, but it still does not work. Since the image shows up correctly in show.html.erb, I don't think this is a problem..</p>
  
  <p>I should have used Paperclip instead... But, I have heard good things about Carrierwave, so I really want to get this to work.</p>
  
  <p>Here is my index.html.erb</p>
  
  <pre><code>&lt;div class="jumbotron"&gt;
    &lt;h2&gt;Ipsum Lorem Ipsum Loream&lt;/h2&gt;
    &lt;h3&gt;Ipsum Lorem Ipsum Lorem &lt;br&gt;
      Ipsum Lorem Ipsum Lorem&lt;h3&gt;
  &lt;/div&gt;
  
  &lt;div class="center"&gt;
    &lt;div class="row"&gt;
      &lt;% @lectures.each do |lecture| %&gt;
        &lt;div class="col-md-3"&gt;
          &lt;div class="thumbnail"&gt;
  
          &lt;%= image_tag @lecture.thumbnail_url(:thumb) %&gt;
  
            &lt;div class="caption"&gt;
              &lt;h3&gt;&lt;%= lecture.name %&gt;&lt;/h3&gt;
              &lt;p&gt;&lt;%= number_to_currency(lecture.price) %&gt;&lt;/p&gt;
              &lt;p&gt;&lt;%= lecture.description %&gt;&lt;/p&gt;
              &lt;p&gt;&lt;%= "lecturer: #{lecture.user.name}" %&gt;&lt;/p&gt;
              &lt;%= link_to 'Show', lecture, class: "btn btn-link" %&gt;
            &lt;/div&gt;
          &lt;/div&gt;
  
        &lt;/div&gt;
      &lt;% end %&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;br&gt;
  
  &lt;% if user_signed_in? %&gt;
    &lt;%= link_to 'New Lecture', new_lecture_path %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>And here's my show.html.er</p>
  
  <pre><code>&lt;%= image_tag @lecture.thumbnail_url(:thumb) %&gt;
  
  &lt;div class="row"&gt;
      &lt;div class="col-md-6"&gt;
  
          &lt;h2&gt;&lt;strong&gt;Lecture Title: &lt;/strong&gt;&lt;%= @lecture.name %&gt;&lt;/h2&gt;
          &lt;p&gt;&lt;strong&gt;Descriptions: &lt;/strong&gt;&lt;%= @lecture.description %&gt;&lt;/p&gt;
          &lt;p&gt;&lt;strong&gt;Price: &lt;/strong&gt;&lt;%= @lecture.price %&gt;&lt;/p&gt;
  
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;% if current_user == @lecture.user %&gt;
  &lt;%= link_to 'Edit', edit_lecture_path(@lecture) %&gt; |
  &lt;% end %&gt;
  &lt;%= link_to 'Back', lectures_path %&gt;
  </code></pre>
  
  <p>Here is my app/uploaders/thumbnail_uploader.rb</p>
  
  <pre><code># encoding: utf-8
  
  class ThumbnailUploader &lt; CarrierWave::Uploader::Base
  
    # Include RMagick or MiniMagick support:
    # include CarrierWave::RMagick
    include CarrierWave::MiniMagick
  
    # Choose what kind of storage to use for this uploader:
    storage :file
    # storage :fog
  
    # Override the directory where uploaded files will be stored.
    # This is a sensible default for uploaders that are meant to be mounted:
    def store_dir
      "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
    end
  
    # Provide a default URL as a default if there hasn't been a file uploaded:
    # def default_url
    #   # For Rails 3.1+ asset pipeline compatibility:
    #   # ActionController::Base.helpers.asset_path("fallback/" + [version_name,         "default.png"].compact.join('_'))
    #
    #   "/images/fallback/" + [version_name, "default.png"].compact.join('_')
    # end
  
    # Process files as they are uploaded:
    process :resize_to_fit =&gt; [200, 300]
    #
    # def scale(width, height)
    #   # do something
    # end
  
    # Create different versions of your uploaded files:
    version :thumb do
       process :resize_to_fit =&gt; [200, 200]
    end
  
    # Add a white list of extensions which are allowed to be uploaded.
    # For images you might use something like this:
    def extension_white_list
       %w(jpg jpeg gif png)
    end
  
    # Override the filename of the uploaded files:
    # Avoid using model.id or version_name here, see uploader/store.rb for details.
    # def filename
    #   "something.jpg" if original_filename
    # end
  
  end
  </code></pre>
  
  <p>Thank you in advance for your awesome help!</p>