wblog/app/controllers/photos_controller.rb

12 lines
224 B
Ruby

class PhotosController < ApplicationController
def create
@photo = Photo.new(image: params["Filedata"])
@photo.save!
render :text=> md_url(@photo.image.url)
end
def md_url(url)
"![](#{url})"
end
end