On Mar-25-2013, at 8:01 PM, Cedric Sohrauer <sohrauer@googlemail.com>
wrote:> While this feature would be very useful for my special use case (my
application has no access to the cdn the assets are hosted on and therefore we
have quite a lot of switches when we can and can''t use the cdn), it may
not be for others. What do you guys think is this a change worth investing some
time into and putting together a pull request?
Could you elaborate a bit more on these requirements?
The second parameter passed into the call() method of the asset host is the
request object. In theory it should be possible to make any decision the
controller can make. I would personally think it makes most sense to keep the
logic of which asset host to use encapsulated in that single place.
Do you have the situation where different routes have different CDNs? Or is it
simply different environments? In my project, we have a YML file with the CDN
url for the environment (using %d as a placeholder for the actual asset host).
It may also be interesting for you to note that the generated assets (SCSS) will
have absolute paths to images if you are using the image helpers. This also
makes it significantly more difficult to have different CDN per route,
especially if some CDN is not available to some route.
--
Tejas Dinkar
http://c42.in
C42 Engineering - The team behind RubyMonk
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to rubyonrails-core+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-core@googlegroups.com.
Visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.