2011-10-26 65 views
0

此行西納特拉無法看到文件

<script type="text/JavaScript" src="public/js/jquery.js"></script> 

拋出arror

GET http://localhost/ajax/public/js/jquery.js 404 (Not Found) 

不 '公' 是一樣的。

它的工作沒有公開我在我的應用改變了這種後:

get '/' do 
    erb :main 

end 

到:

get '/sth_else' do 
    erb :main 

end 

但我想加載一個頁面只是www.page.com/沒有進一步參數。 請幫我一把。

+0

什麼服務器您使用的? –

+0

您是否嘗試過使用url-helper? – robustus

回答

5

ajax在你的路徑中做什麼?如果你的Javascript文件在public/js/jquery.js。你應該能夠

http://localhost:port/js/jquery.js 

來接他們,並能夠將它們包括與/js/jquery.js(介意開始/

+0

你說得對。我只需要添加/ajax/js/jquery.js。/ajax /是我本地主機上的應用程序之一。 – gisek