You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: photos_controller.rb
    path of file: ./repos/Sitepoint-source/SimpleUploader/app/controllers
    
    the code of the file until where you have to start completion: class PhotosController < ApplicationController
  def index
    @photos = Photo.order('created_at')
  end

  def new

    
  def create
    @photo = Photo.new(photo_params)
    if @photo.save
      flash[:success] = "The photo was added!"
      redirect_to root_path
    else
      render 'new'
    end