base_controller.rb 458 B

123456789101112131415161718192021222324
  1. # frozen_string_literal: true
  2. class Redirect::BaseController < ApplicationController
  3. vary_by 'Accept-Language'
  4. before_action :set_resource
  5. before_action :set_app_body_class
  6. def show
  7. @redirect_path = ActivityPub::TagManager.instance.url_for(@resource)
  8. render 'redirects/show', layout: 'application'
  9. end
  10. private
  11. def set_app_body_class
  12. @body_classes = 'app-body'
  13. end
  14. def set_resource
  15. raise NotImplementedError
  16. end
  17. end