作者whk ()
看板Ruby
標題[問題]請教檔案路徑與網址路徑的關係
時間Wed Jan 23 14:34:08 2008
環境:
Ruby 1.8.6
Rails 2.0.2
狀況:
請教一個路徑的問題
小弟想請教一個路徑問題
我執行了
step1 rails demo(在rails_apps下建立了demo資料夾)
step2 cd demo
step3 ruby script/server(可正確開啟)
step4 ruby script/generate controller Say(建了一個叫Say的Controller)
step5 然後更改一下了這個say_controller.rb檔
=============================================
class SayController<ApplicationController
def hello(新增的)
end(新增的)
end
=============================================
step 6 再去
http://localhost:3000/Say/hello
但是在網頁端出現
Routing Error
No route matches "/layouts" with {:method=>:get}
所以想問在
http://localhost:3000/AAA/BBB
AAA是指執行的controller
BBB是action
那完全不用考慮目錄的路徑嗎?
例如,我建了demo資料夾
是不是應該要這樣(如下)
http://localhost:3000/demo/Say/controller
還請前輩解釋一下囉~
附錄:無
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 211.72.212.241
1F:推 shelary:跟demo目錄無關..不須要加 /demo 01/23 14:40
3F:推 godfat:請參考 routes.rb 01/23 19:22