環境:
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
推
01/23 14:40, , 1F
01/23 14:40, 1F
→
01/23 15:02, , 2F
01/23 15:02, 2F
推
01/23 19:22, , 3F
01/23 19:22, 3F
Ruby 近期熱門文章
PTT數位生活區 即時熱門文章