Class: SimpleDragonflyPreview::ImageController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/simple_dragonfly_preview/image_controller.rb

Instance Method Summary collapse

Instance Method Details

#iframeObject



14
15
# File 'app/controllers/simple_dragonfly_preview/image_controller.rb', line 14

def iframe
end

#uploadObject



4
5
6
7
8
9
10
11
12
# File 'app/controllers/simple_dragonfly_preview/image_controller.rb', line 4

def upload
  if params[:image].present?
    app = Dragonfly.app
    uid = app.store(params[:image].tempfile)
    @image = app.fetch(uid)
    @retained_image = Dragonfly::Serializer.json_encode(uid: @image.uid) if @image 
  end
  render :iframe
end