2024-01-24 05:49:19 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class Redirect::BaseController < ApplicationController
|
|
|
|
vary_by 'Accept-Language'
|
|
|
|
|
2024-01-26 15:04:02 -05:00
|
|
|
before_action :set_pack
|
2024-01-24 05:49:19 -05:00
|
|
|
before_action :set_resource
|
|
|
|
before_action :set_app_body_class
|
|
|
|
|
|
|
|
def show
|
|
|
|
@redirect_path = ActivityPub::TagManager.instance.url_for(@resource)
|
|
|
|
|
|
|
|
render 'redirects/show', layout: 'application'
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def set_app_body_class
|
|
|
|
@body_classes = 'app-body'
|
|
|
|
end
|
|
|
|
|
|
|
|
def set_resource
|
|
|
|
raise NotImplementedError
|
|
|
|
end
|
2024-01-26 15:04:02 -05:00
|
|
|
|
|
|
|
def set_pack
|
|
|
|
use_pack 'public'
|
|
|
|
end
|
2024-01-24 05:49:19 -05:00
|
|
|
end
|