You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
570 B

  1. # frozen_string_literal: true
  2. class EmojisController < ApplicationController
  3. before_action :set_emoji
  4. before_action :set_cache_headers
  5. def show
  6. respond_to do |format|
  7. format.json do
  8. render_cached_json(['activitypub', 'emoji', @emoji], content_type: 'application/activity+json') do
  9. ActiveModelSerializers::SerializableResource.new(@emoji, serializer: ActivityPub::EmojiSerializer, adapter: ActivityPub::Adapter)
  10. end
  11. end
  12. end
  13. end
  14. private
  15. def set_emoji
  16. @emoji = CustomEmoji.local.find(params[:id])
  17. end
  18. end