Class: SimpleDragonflyPreview::ImageController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- SimpleDragonflyPreview::ImageController
- Defined in:
- app/controllers/simple_dragonfly_preview/image_controller.rb
Instance Method Summary collapse
Instance Method Details
#iframe ⇒ Object
16 17 |
# File 'app/controllers/simple_dragonfly_preview/image_controller.rb', line 16 def iframe end |
#upload ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 |
# 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) filename = params[:image].original_filename @image = app.fetch(uid) @retained_image = Dragonfly::Serializer.json_b64_encode(uid: uid, name: filename) if @image @resize = params[:resize] end render :iframe end |