title: Rails fetch image and display in my index view
body: <p>I am trying to build a rails application in which I am uploading image using carrierwave .After uploading now i want to retrieve that image and display in my index page but i don't know how to specify the path of the image or how to retrieve that image and show it in view.Also i want to display the details like title and description which I have uploaded 
  <br>
  [uploads_controller.rb]
  <br></p>
  
  <pre><code>class UploadsController &lt; ApplicationController
    before_action :authenticate_user! 
  
    def index
      @uploads=Upload.all
    end
  
    def new
      @upload=Upload.new
    end
  
  
    def create
  
      @upload=Upload.new(params_abc)
  
       if  @upload.save  
          redirect_to  @upload
       else
         render 'new'
       end
  
    end
  def show
      @post = find_params
    end
  
  private
  
    def params_abc
          params.require(:upload).permit(:title,:description,:tageline)
    end
    def find_params
        Post.find(params[:id])
      end
  
  end
  </code></pre>
  
  <p><br>
  [uploads/new.html.erb]
  <br></p>
  
  <pre><code>&lt;%= form_for @upload,html: { multipart: true } do |f| %&gt;
      &lt;% if @upload.errors.any? %&gt;
          &lt;div id="errors"&gt;
              &lt;h2&gt;&lt;%= pluralize(@upload.errors.count, "error") %&gt; prevented this post from saving:&lt;/h2&gt;
              &lt;ul&gt;
                  &lt;% @upload.errors.full_messages.each do |msg| %&gt;
                      &lt;li&gt;&lt;%= msg %&gt;&lt;/li&gt;
                  &lt;% end %&gt;
              &lt;/ul&gt;
          &lt;/div&gt;
      &lt;% end %&gt;
  
      &lt;%= f.label :title %&gt;&lt;br&gt;
      &lt;%= f.text_field :title %&gt;&lt;br&gt;
      &lt;br&gt;
  
      &lt;%= f.label :description %&gt;&lt;br&gt;
      &lt;%= f.text_field :description %&gt;&lt;br&gt;
       &lt;br&gt;
  
      &lt;%= f.label :tageline %&gt;&lt;br&gt;
      &lt;%= f.file_field :tageline%&gt;&lt;br&gt;
      &lt;br&gt;
  
      &lt;%= f.submit %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p><br>
  [uploads/index.html.erb]
  <br></p>
  
  <pre><code>&lt;% @uploads.each do |f| %&gt;                      
  
  &lt;div id="page_wrapper"&gt;
  
          &lt;div id="profile_image"&gt;
              &lt;%= f.image "uploadss/post/"%&gt;
          &lt;/div&gt;
  
          &lt;div id="content_link"&gt;
              &lt;div id="content"&gt;
                  &lt;p&gt;Being the richest man in the cemetery doesn't matter to me. Going to bed at night saying we've done something wonderful, that's what matters to me.
                  &lt;/p&gt;        
              &lt;/div&gt;
  
              &lt;div id="link"&gt;
  
                  &lt;button type="button" &gt;Read More&lt;/button&gt;
              &lt;/div&gt;  
          &lt;div&gt;
  
  &lt;/div&gt;
      &lt;br&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p><br>
  [migration]
  <br></p>
  
  <pre><code>class CreateUploads &lt; ActiveRecord::Migration
    def change
      create_table :uploads do |t|
          t.string :title, null: false
          t.string :description, null: false
          t.string :tageline, null: false
          t.timestamps
      end
    end
  end
  </code></pre>
  
  <p><br>
  [upload.rb]
  <br></p>
  
  <pre><code>class Upload &lt; ActiveRecord::Base
  
      validates :description,  presence: true
      validates :title,  presence: true
      validates :tageline, presence: true
  
      mount_uploader :tageline, TagelineUploader 
  
  
  end
  </code></pre>
  
  <p><br>
  [uploader]
  <br></p>
  
  <pre><code># encoding: utf-8
  
  class TagelineUploader &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
      "uploadss/post/#{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 :scale =&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; [50, 50]
    # 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>