class PhotosController < ApplicationController
  def create
  end
end

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

Add the create method for uploading the photo and return the url of the photo to the form.
Add the create method for uploading the photo and return the url of the photo to the form.
