title: Get file name of Carrierwave upload in rails controller
body: <p>I need to get the file name of and uploaded file in my controller so that i could set a default title (or name) to the uploaded file if the user did not assign one. I use Carrierwave to upload ing files.</p>
  
  <p>My controller create action looks like this:</p>
  
  <pre><code>  def create
      @photo = Photo.new(params[:photo])
      @photo.user_id = current_user.id
  
  
      respond_to do |format|
        if @photo.save
          format.html { redirect_to @photo, notice: 'Photo was successfully created.' }
          format.json { render action: 'show', status: :created, location: @photo }
        else
          format.html { render action: 'new' }
          format.json { render json: @photo.errors, status: :unprocessable_entity }
        end
      end
    end
  </code></pre>