Clean up asset_host and asset_path.

This commit is contained in:
José Valim 2010-12-09 13:40:45 +01:00
parent cc70ac9508
commit 8e6d27641c
3 changed files with 7 additions and 20 deletions

View File

@ -19,8 +19,8 @@ module ActionMailer
options.stylesheets_dir ||= paths["public/stylesheets"].first options.stylesheets_dir ||= paths["public/stylesheets"].first
# make sure readers methods get compiled # make sure readers methods get compiled
options.asset_path ||= nil options.asset_path ||= app.config.asset_path
options.asset_host ||= nil options.asset_host ||= app.config.asset_host
ActiveSupport.on_load(:action_mailer) do ActiveSupport.on_load(:action_mailer) do
include AbstractController::UrlFor include AbstractController::UrlFor

View File

@ -27,8 +27,8 @@ module ActionController
options.page_cache_directory ||= paths["public"].first options.page_cache_directory ||= paths["public"].first
# make sure readers methods get compiled # make sure readers methods get compiled
options.asset_path ||= nil options.asset_path ||= app.config.asset_path
options.asset_host ||= nil options.asset_host ||= app.config.asset_host
ActiveSupport.on_load(:action_controller) do ActiveSupport.on_load(:action_controller) do
include app.routes.mounted_helpers include app.routes.mounted_helpers

View File

@ -4,12 +4,12 @@ require 'rails/engine/configuration'
module Rails module Rails
class Application class Application
class Configuration < ::Rails::Engine::Configuration class Configuration < ::Rails::Engine::Configuration
attr_accessor :allow_concurrency, :cache_classes, :cache_store, attr_accessor :allow_concurrency, :asset_host, :cache_classes, :cache_store,
:encoding, :consider_all_requests_local, :dependency_loading, :encoding, :consider_all_requests_local, :dependency_loading,
:filter_parameters, :log_level, :logger, :filter_parameters, :helpers_paths, :log_level, :logger,
:preload_frameworks, :reload_plugins, :preload_frameworks, :reload_plugins,
:secret_token, :serve_static_assets, :session_options, :secret_token, :serve_static_assets, :session_options,
:time_zone, :whiny_nils, :helpers_paths :time_zone, :whiny_nils
def initialize(*) def initialize(*)
super super
@ -24,22 +24,9 @@ module Rails
@session_options = {} @session_options = {}
@time_zone = "UTC" @time_zone = "UTC"
@middleware = app_middleware @middleware = app_middleware
@asset_path = '/'
@generators = app_generators @generators = app_generators
end end
def asset_path=(value)
action_mailer.asset_path = value if respond_to?(:action_mailer) && action_mailer
action_controller.asset_path = value if respond_to?(:action_controller) && action_controller
super(value)
end
def asset_host=(value)
action_mailer.asset_host = value if action_mailer
action_controller.asset_host = value if action_controller
super(value)
end
def compiled_asset_path def compiled_asset_path
"/" "/"
end end