wblog/app/controllers/photos_controller.rb

13 lines
235 B
Ruby

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