title: Ruby on Rails: proper use of image_tag with carrierwave on a nested model
body: <p>I have partial named _userbox, which displays data grabbed from the user model. I also have a seperate image model, which stores information about images.</p>
  
  <pre><code>class User
    ...
    has_many :images, :dependent =&gt; :destroy  
    accepts_nested_attributes_for :images, allow_destroy: true    
    ...
  end
  
  class Image
    ...
    attr_accessible :image_priority, :image_title, :image_location
    belongs_to :user
    mount_uploader :image_location, ProfilePictureUploader
    ...
  end
  
  _userbox.html.erb
      &lt;% @users.each do |user| %&gt;     
        &lt;tr&gt;
          &lt;td&gt;&lt;%= image_tag user.images.image_location.url.to_s %&gt;&lt;/td&gt;
          &lt;td valign="top"&gt;
            &lt;p&gt;&lt;%= link_to user.first_name, user_path(user) %&gt;&lt;/p&gt;
            &lt;p&gt;&lt;%= age(user.date_of_birth) %&gt; / &lt;%= user.gender %&gt; / &lt;%= user.orientation %&gt;&lt;/p&gt;
            &lt;p&gt;from &lt;%= user.location %&gt;&lt;/p&gt;
            &lt;p&gt;Question? Answer answer answer answer answer answer answer&lt;/p&gt;
          &lt;/td&gt;
        &lt;/tr&gt;
      &lt;% end %&gt;
  </code></pre>
  
  <p>It works fine, except image_tag. I'm using the carrierwave gem to upload image files. The files are uploaded, but I don't know what is the proper way to acesss them in my view.
  I get error message like:
  undefined method `image_location' for []:ActiveRecord::Relation</p>
  
  <p>What is the proper way to use that image_tag?</p>