You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: embed_controller.rb
    path of file: ./repos/discourse/app/controllers
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

class EmbedController < ApplicationController
  include TopicQueryParams

  skip_before_action :check_xhr, :preload_json, :verify_authenticity_token

  before_action :prepare_embeddable, except: [:info]
  before_action :ensure_api_request, only: [:info]

  layout "embed"

  rescue_from Discourse::InvalidAccess do
    if current_user.try(:admin?)
      @setup_url = "#{Discourse.base_url}/admin/customize/embedding"
      @show_reason = true
      @hosts = EmbeddableHost.all
    end
    ren
    
  def count
    embed_urls = params[:embed_url]
    by_url = {}

    if embed_urls.present?
      urls = embed_urls.map { |u| u.sub(/#discourse-comments\z/, "").sub(%r{/\z}, "") }
      topic_embeds = TopicEmbed.where(embed_url: urls).includes(:topic).references(:topic)

      topic_embeds.each do |te|
        url = te.embed_url
        url = "#{url}#discourse-comments" unless params[:embed_url].include?(url)
        if te.topic.present?
          by_url[url] = I18n.t("embed.replies", count: te.topic.posts_count - 1)
        else
          by_url[url] = I18n.t("embed.replies", count: 0)
        end
      end