Skip to content

Instantly share code, notes, and snippets.

@richardtifelt
Created June 15, 2011 12:48
Show Gist options
  • Save richardtifelt/1027007 to your computer and use it in GitHub Desktop.
Save richardtifelt/1027007 to your computer and use it in GitHub Desktop.
Computing asset host in my Rails 3 models using compute_asset_host
module Mynewsdesk
module Helpers
def self.compute_asset_host(path)
host_config = Mynewsdesk::Application.config.asset_host
if host_config.respond_to?(:call) && host_config.arity == 1
host_config.call(path)
else
raise "Please set up config.asset_host with a proc that takes one argument"
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment