在更正應用程序中的其他一些錯誤之後,我發現一個頁面在每次請求時都會呈現兩次。Rails複製請求
Rails的正常,經過幾次完成請求,只需啓動另一個請求。
起初以爲是Firebug的問題或YSlow的做其他的請求,但經過更多的測試重複依然存在,我放棄這些原因。
我試着調試甚至鐵軌一步在請求步驟,它正常進入和完成第一次請求之後,我在同一個調試器開始行攔住,這一次的第二個請求。
印刷一些線和東西清楚地看到日誌,並清楚地使得2個請求。
我還發現,我也無法解釋
日誌的該位表示一個右後的第一個請求,並結束了幾個奇怪的要求,有沒有佈局一個奇怪的指標要求,那麼同樣的請求再次開始進行處理:
Processing ArtistImagesController#index (for 192.168.0.11 at 2010-07-08 15:10:56) [GET]
Parameters: {"action"=>"index", "locale"=>"pt", "controller"=>"artist_images", "artist_id"=>"2-tom-welling"}
#^ Start of first request
#v end of first request
Completed in 812ms (View: 429, DB: 41) | 200 OK [http://192.168.0.20/artistas/2-tom-welling/imagens]
SQL (0.2ms) SET NAMES 'utf8'
SQL (0.2ms) SET SQL_AUTO_IS_NULL=0
# v wierd request
Processing ApplicationController#index (for 192.168.0.11 at 2010-07-08 15:10:59) [GET]
Rendering rescues/layout (not_found)
-----------------------------------------------------> html
SQL (0.2ms) SET NAMES 'utf8'
SQL (0.2ms) SET SQL_AUTO_IS_NULL=0
# v start of second request
Processing ArtistImagesController#index (for 192.168.0.11 at 2010-07-08 15:11:00) [GET]
Parameters: {"action"=>"index", "locale"=>"pt", "controller"=>"artist_images", "artist_id"=>"2-tom-welling"}
記住,被進入的頁面只有一次產生所有這些請求:/ 搜索可能的循環代碼或任何類型的錯誤,但沒有發現任何。
請幫助非常appretiated
我以前也有過這個問題:\。我很想看到這個答案! – amfeng 2010-07-08 18:24:53