```ruby
class PhotosController < ApplicationController
  def create
  end
end
```

Add the create method for uploading the photo and return the url of the photo to the form.
user
```ruby
class PhotosController < ApplicationController
  def create
    @photo = Photo.new
    @photo.photo = params[:Filedata]
    @photo.user_id = current_user.id
    @photo.save
    render text: @photo.photo.url
  end
end
```
assistant