[問題] rails 的小問題

看板Ruby作者 (風起的瞬間)時間17年前 (2007/01/20 11:19), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串1/2 (看更多)
環境: 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)

01/20 12:05, , 1F
hello action 對應的應該是 hello.rhtml view 吧. @@a
01/20 12:05, 1F
※ 編輯: fayhong 來自: 220.132.64.184 (01/20 12:46) ※ 編輯: fayhong 來自: 220.132.64.184 (01/20 12:56)
文章代碼(AID): #15iOfNkd (Ruby)
文章代碼(AID): #15iOfNkd (Ruby)