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!
|
|
|
|
render :text=> md_url(@photo.image.url)
|
|
|
|
end
|
|
|
|
|
|
|
|
def md_url(url)
|
|
|
|
"![](#{url})"
|
|
|
|
end
|
|
|
|
end
|