看板 Ruby 關於我們 聯絡資訊
※ 引述《shelary (台中喵小咩)》之銘言: : 你也沒把你的 conf 貼上來..怎麼知道是不是你那裡設錯 : 我覺得你乾脆簡單一點..反向思考 : 把你的 php 放到 rails 的 public 目錄下 : 然後 apache 加 ProxyPass /php ! : 這樣 http://localhost/ 是 rails : http://localhost/php 是 php : 是不是簡單多了 : 至於第二個問題 : 在 orders 的 model 裡加 : def to_label : price : end 原來是因為我在 Virtual Host 有設一個 DocumentRoot C:\ruby\workspace\myapp\public 所以 localhost 都會被轉到 public 下 把他註解掉就 ok 了,完整設定如下: <VirtualHost *:80> AddDefaultCharset utf-8 ServerName * # ---> 就是他 DocumentRoot C:\ruby\workspace\myapp\public ErrorDocument 500 /500.html ErrorDocument 404 /404.html ProxyPass /myapp http://127.0.0.1:4000/myapp ProxyPassReverse /myapp http://127.0.0.1:4000/myapp ProxyPass /images ! ProxyPass /stylesheets ! ProxyPass /javascripts ! #continue with other static files that should be served by apache Alias /images C:\ruby\workspace\myapp\public\images Alias /stylesheets C:\ruby\workspace\myapp\public\stylesheets Alias /javascripts C:\ruby\workspace\myapp\public\javascripts #continue with aliases for static content <Proxy *> Order deny,allow Allow from all </Proxy> <Directory C:\ruby\workspace\myapp\public\> Options Indexes FollowSymLinks Order allow,deny allow from all </Directory> </VirtualHost> 然後第二問題我加了那個 function 了,但是沒作用,好怪 @@? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 219.86.99.66 ※ 編輯: dream1129 來自: 219.86.99.66 (09/10 17:16)
godfat:我猜你哪裡寫錯了,因為加那個應該沒有錯,或是試試 name 09/11 21:12
dream1129:好像是因為我用啟動service的mongrel來看,所以沒辦法即 09/11 23:37
dream1129:時更新,用 script/server 的來看,就ok了! 09/11 23:38
isfore:注意 Rails Env 會有不同的 cache。 10/24 15:24