CUT
On 7 March 2013 10:49, ngw <n...@nofeed.org> wrote:
> On Thursday, March 7, 2013 11:45:22 AM UTC+1, ngw wrote:
>>
>> CUT
>
>
> Sorry for the formatting
>
> config.action_controller.asset_host = Proc.new { |source, request=nil|
Why have you got request=nil in the line above?
ngw
Looking at the code, rails uses the arity of your proc to decide what to do. If the arity is 1 it passes just the source, if it is 2 it passes both, but will blow up when there is no request available (and warn you to) and if the arity is negative (you can pass as many optional arguments as you want) it passes both.the problem is that lambda {|x,y=nil|} counts as an arity of 1, so rails doesn't try to pass the request, if you do lambda {|x,*y|} then you should get the request in y (y will be an array).However, you will presumably still need to deal with the fact that your precompiled assets will be either all ssl or all non ssl - if you serve some css that references (eg via background-url) a non ssl asset then I'd expect you to run into mixed content warnings.