views:

354

answers:

4

I have add stylesheet link tag to my application. I'm sure its worked. because in another place is working. but if I run at my computer it did not working. I mean my application cant load css

when I seen at view source the result is :

<script src="http://localhost:3000//javascripts/application.js?1258048544" type="text/javascript"></script>

<link href="http://localhost:3000//stylesheets/jquery.autocomplete.css?1258048544" media="screen" rel="stylesheet" type="text/css" />

I'm sure it shouldnt appear double slash // after domain or localhost:3000. weird why in other computer it was worked.

Have you any suggestion for this case? how to change double slash with single?

btw I use ubuntu.

A: 

Try these helper methods:

<%= stylesheet_link_merged 'jquery.autocomplete.css' %>
<%= javascript_include_tag 'application.js'%>

*Works with http://synthesis.sbecker.net/pages/asset%5Fpackager

qwertypants
+1  A: 

The Rails helpers should not render an absolute url, it should simply be a relative path.

<link href="/stylesheets/jquery.autocomplete.css?1250281505" media="screen" rel="stylesheet" type="text/css" />

Make sure you are using the stylesheet_link_tag properly - do not use a leading slash or the trailing .css when specifying the stylesheet name. Same for javascript_include_tag.

<%= stylesheet_link_tag "jquery.autocomplete" %>
Jonathan Julian
Yes i have do like what you said, but is not working.
Kuya
Look this is my code <%= javascript_include_tag :defaults, 'jquery/jquery.facebox', 'jquery/jquery.bgiframe', 'jquery/jquery.autocomplete', 'fckeditor/fckeditor' %> <%= stylesheet_link_tag 'jquery.autocomplete'%> <%= stylesheet_link_tag 'main', 'facebox' %>
Kuya
Maybe you have `ActionController::Base.asset_host = 'localhost:3000/'` set in your environment?
Jonathan Julian
No I just set my environtment default
Kuya
A: 

I had a similar problem and just discovered the issue–it may or may not work for you.

My app uses the Facebooker gem to integrate with Facebook Connect. In my facebooker.yml file, if I had a trailing slash in my callback_url setting, I would get the same behavior as you described. Removing the trailing slash fixed the issue.

Callmeed
A: 

Callmeed's answer helped solving the same exact same problem. I commented out the :callback_url from facebooker.yml and everything is back to normal.

Thanks.. This bug was making me go nuts!

makuchaku