http://railsbridge-docs-zh-tw.herokuapp.com/docs/
rails101
http://courses.growthschool.com/courses/rails-101/lectures/792006Rake
在終端機輸入
rake routes。你會看到像這樣的東西:$ rake routes
Prefix Verb URI Pattern Controller#Action
topics GET /topics(.:format) topics#index
POST /topics(.:format) topics#create
new_topic GET /topics/new(.:format) topics#new
edit_topic GET /topics/:id/edit(.:format) topics#edit
topic GET /topics/:id(.:format) topics#show
PATCH /topics/:id(.:format) topics#update
PUT /topics/:id(.:format) topics#update
DELETE /topics/:id(.:format) topics#destroy
root GET / topics#index
這樣就可以顯示所有你的應用程式會處理的 URL 了。有些冒號(
:)開頭的是變數, :id 表示資料的 id 編號。括號框起來的是可以省略的。
在 Rails 4 裡面,你也可以在開發環境從你的網站上直接看到這個資訊。請打開http://localhost:3000/rails/info
沒有留言:
張貼留言