看板 Ruby 關於我們 聯絡資訊
環境: WinXP + Ruby 1.8.5 + Rails 1.2.1 + RedRails AP Server: Mongrel 狀況: 我在 say controller 下, 某個叫 hello 的 action 中 有個 instance variable 叫 @time ( @time = Time.now ) (follow Agile Rails 那本書第一章的範例) 想在 hello.rhtml 裡的 <%= @time %> 當中顯示時間 (呃...這裡是 hello.rhtml 沒錯, 我打錯字了 感謝 xamous 兄 :) ) 可是現在問題就是, 照著書上寫的東西寫了 卻沒顯示任何東西 當我改成 <%= Time.now %> 時 又有東西出現了 ~"~a 想請問各位前輩有什麼建議的嗎 @@a 附註: env 是 production, 因此我看了一下 log 可是 log 檔裡沒有什麼異狀 : Processing SayController#hello (for my ip at 2007-01-20 11:40:34) [GET] Session ID: 2a1e41de8ead800907868a72bc0af14c Parameters: {"action"=>"hello", "controller"=>"say"} Rendering say/hello Completed in 0.00010 (10000 reqs/sec) | Rendering: 0.00000 (0%) | 200 OK [http://my host/say/hello] -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 220.132.64.184 ※ 編輯: fayhong 來自: 220.132.64.184 (01/20 11:33) ※ 編輯: fayhong 來自: 220.132.64.184 (01/20 11:34)
xamous:hello action 對應的應該是 hello.rhtml view 吧. @@a 01/20 12:05
※ 編輯: fayhong 來自: 220.132.64.184 (01/20 12:46) ※ 編輯: fayhong 來自: 220.132.64.184 (01/20 12:56)