2012-06-25 00:09:44 +08:00
|
|
|
class PhotosController < ApplicationController
|
|
|
|
def create
|
2014-06-03 23:25:45 +08:00
|
|
|
@photo = Photo.new(image: params["Filedata"])
|
2012-06-25 00:09:44 +08:00
|
|
|
@photo.save!
|
2017-07-20 16:05:12 +08:00
|
|
|
render :plain => md_url(@photo.image.url)
|
2012-06-25 00:09:44 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
def md_url(url)
|
|
|
|
"![](#{url})"
|
|
|
|
end
|
|
|
|
end
|