aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage/app/controllers/active_storage/previews_controller.rb
blob: aa7ef58ca415482b7985f363358cb5c2a82f8a19 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
# frozen_string_literal: true

class ActiveStorage::PreviewsController < ActionController::Base
  include ActiveStorage::SetBlob

  def show
    expires_in ActiveStorage::Blob.service.url_expires_in
    redirect_to ActiveStorage::Preview.new(@blob, params[:variation_key]).processed.service_url(disposition: params[:disposition])
  end
end