开发者

Where is asset_host rails 3?

开发者 https://www.devze.com 2022-12-28 17:04 出处:网络
What happened to asset_host in rails 3? Earlier I can put following code into development.rb and get all assets not present on development:

What happened to asset_host in rails 3? Earlier I can put following code into development.rb and get all assets not present on development:

ActionController::Base.asset_host = proc do |source, request|
  unless File.exist?(File.join(RAILS_ROOT, 'public', source.sub(/\?\d+$/, '')))
    'http://example.com'
  end
end
开发者_运维技巧

But in rails 3 there is no such method and google does not help me.


The asset_host config information goes into you environment files, which have changed format slightly:

// environments/production.rb
Infinity::Application.configure do

  config.action_controller.asset_host = "http://assets.example.com"

end

I'm not sure this will let you override in the same way as your code, though.

0

精彩评论

暂无评论...
验证码 换一张
取 消