Created
June 15, 2011 12:48
-
-
Save richardtifelt/1027007 to your computer and use it in GitHub Desktop.
Computing asset host in my Rails 3 models using compute_asset_host
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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