Class: PrometheeController

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

Instance Method Summary collapse

Instance Method Details

#blob_createObject



9
10
11
12
13
14
15
# File 'app/controllers/promethee_controller.rb', line 9

def blob_create
  io = params[:file].to_io
  filename = params[:file].original_filename
  content_type = params[:file].content_type
  blob = ActiveStorage::Blob.create_after_upload! io: io, filename: filename, content_type: content_type
  render json: { id: blob.id, name: filename }
end

#blob_showObject



17
18
19
20
# File 'app/controllers/promethee_controller.rb', line 17

def blob_show
  blob = ActiveStorage::Blob.find params[:id]
  redirect_to url_for(blob.variant(resize: '720'))
end

#previewObject



5
6
7
# File 'app/controllers/promethee_controller.rb', line 5

def preview
  @data = params[:data]
end