class TinyMCE::Rails::Engine

Public Class Methods

asset_host() click to toggle source
# File lib/tinymce/rails/engine.rb, line 39
def self.asset_host
  host = Rails.application.config.action_controller.asset_host
  
  if host.respond_to?(:call)
    # Callable asset hosts cannot be supported during
    # precompilation as there is no request object
    nil
  elsif host =~ /%d/
    # Load all TinyMCE assets from the first asset host
    normalize_host(host % 0)
  else
    normalize_host(host)
  end
end
base() click to toggle source
# File lib/tinymce/rails/engine.rb, line 18
def self.base
  config.tinymce.base || default_base
end
default_base() click to toggle source
# File lib/tinymce/rails/engine.rb, line 22
def self.default_base
  File.join(asset_host || "", relative_url_root || "",
            Rails.application.config.assets.prefix || "/",
            "tinymce")
end
normalize_host(host) click to toggle source
# File lib/tinymce/rails/engine.rb, line 54
def self.normalize_host(host)
  if host =~ /^https?:\/\//
    host
  else
    # Use a protocol-relative URL if not otherwise specified
    "//#{host}"
  end
end
relative_url_root() click to toggle source
# File lib/tinymce/rails/engine.rb, line 28
def self.relative_url_root
  config = Rails.application.config

  if config.respond_to?(:relative_url_root)
    config.relative_url_root
  else
    # Fallback for Rails 3.1
    config.action_controller.relative_url_root
  end
end