看板 Ruby 關於我們 聯絡資訊
※ 引述《windwofswold ( ◤〔ζ狼ζ〕◢)》之銘言: : 各位好 : 小弟學習ROR碰到了一個瓶頸...卻不知到怎麼解開XD : 在一般狀況下,使用WEBrick當伺服器,不是會listen localhost:3000嗎? : 那在瀏覽器瀏覽 http://localhost:3000/的時候 他會連到public/index.htm : 那有沒有辦法 指定為 某個controller裡的action呢? : 小弟試了很久 都試不出來 也都找不到答案Orz : 麻煩大家指點迷津一下啦<(_ _)> config/routes.rb 裡面有行 # You can have the root of your site routed with map.root -- just remember to delete public/index.html. # map.root :controller => "welcome" 把註解拿掉 map.root :controller => "welcome" , :action => "ooxx" ^^你要的controller名稱 ^^^action name -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 220.140.113.247 ※ 編輯: poga 來自: 220.140.113.247 (12/24 00:02)
windwofswold:阿 原來在這Orz 謝謝你^^ 12/24 00:13
zusocfc:千萬別忘記把public底下的index.html送進焚化爐阿! 03/20 09:34