-2

In my html.erb I have this:

<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>   
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script> 
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>

And then a bunch of code dependent on those.

I go to PROD with my rails app and my jquery UI stuff that depends on these above does not work (it works totally fine in dev). I do some research and find the answer to this question:

Rails javascript asset missing after precompile

The gist is - in PROD, rails wants us to preload these assets first. Makes sense. I make the changes and restart the server... but still no dice. But I have a clue! I open up developers tools in Chrome and find:

enter image description here

More research... and I find it's because I'm trying to reach http from an app behind https.

So it comes down to - I really really need to change these lines:

<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>   
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script> 
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>

To something not directly pulling from the http sites. I have preloaded my assets, so allegedly the right stuff is in /public/assets. My issue is - what does the updated link look like, and which of the kabillion files in there do I change my url in my html.erb to? This is where I lack direction.

PinkElephantsOnParade
  • 6,452
  • 12
  • 53
  • 91

1 Answers1

-2

Lazy-as-hell answer is to change the links to https. Sort of doesn't use the whole "precompile" pipeline at all... but at least it gives me my damn jquery just like it appears in DEV.

<link href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>                                                  
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script> 

I won't accept this answer unless it's the only one that gets the job done - surely there is a much more idiomatic way to achieve this.

PinkElephantsOnParade
  • 6,452
  • 12
  • 53
  • 91