Sha256: 26dbd1d0fb5db24c1df60e2b5698e9af002e06c1458dd31497c0e6b84f6d72ad

Contents?: true

Size: 822 Bytes

Versions: 33

Compression:

Stored size: 822 Bytes

Contents

class PrometheeController < ApplicationController
  # This is acceptable because the iframe is sandboxed
  skip_before_action :verify_authenticity_token, only: :preview

  def preview
    @data = params[:data]
    render 'preview', layout: params[:preview_layout] if params.include? :preview_layout
  end

  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

  def blob_show
    # as this is called only from promethee preview it sends an image resized to 720
    blob = ActiveStorage::Blob.find params[:id]
    redirect_to url_for(blob.variant(resize: '720>'))
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
promethee-1.6.49 app/controllers/promethee_controller.rb
promethee-1.6.48 app/controllers/promethee_controller.rb
promethee-1.6.47 app/controllers/promethee_controller.rb
promethee-1.6.46 app/controllers/promethee_controller.rb
promethee-1.6.45 app/controllers/promethee_controller.rb
promethee-1.6.44 app/controllers/promethee_controller.rb
promethee-1.6.43 app/controllers/promethee_controller.rb
promethee-1.6.42 app/controllers/promethee_controller.rb
promethee-1.6.41 app/controllers/promethee_controller.rb
promethee-1.6.40 app/controllers/promethee_controller.rb
promethee-1.6.39 app/controllers/promethee_controller.rb
promethee-1.6.38 app/controllers/promethee_controller.rb
promethee-1.6.37 app/controllers/promethee_controller.rb
promethee-1.6.36 app/controllers/promethee_controller.rb
promethee-1.6.35 app/controllers/promethee_controller.rb
promethee-1.6.34 app/controllers/promethee_controller.rb
promethee-1.6.33 app/controllers/promethee_controller.rb
promethee-1.6.32 app/controllers/promethee_controller.rb
promethee-1.6.31 app/controllers/promethee_controller.rb
promethee-1.6.30 app/controllers/promethee_controller.rb