設定的路線,我想了解如何設置新的路線,但是我選擇不工作,它只是顯示一個「無路由匹配[GET]‘/用戶/ 18 /設置’」。修改配置文件
我想什麼做的是建立一個/設置,將顯示所有用戶信息註冊頁面上輸入/用戶/新及/用戶/ ID /編輯顯示
的routes.rb:
Dating::Application.routes.draw do
get 'signup' => 'users#new'
get 'login' => 'sessions#new'
get 'logout' => 'sessions#destroy'
get 'edit' => 'users#edit'
get "/profile/:id" => "users#show"
get "profile/:id/settings" => 'users#edit'
get 'settings', on: :member
match 'settings' => 'users#settings'
resources :users do
resources :sessions
resources :password_resets
resources :galleries
resources :photos
root to: 'users#new'
root to: 'galleries#index'
末 結束
耙路線:
settings_user GET /users/:id/settings(.:format)用戶#設置GET /users(.:format)users#index GET/users /:id/edit(:格式),用戶#編輯 GET /users/:id(.:format)用戶#顯示 PUT /users/:id(.:format)用戶#更新 DELETE /users/:id(.:format)用戶#銷燬 根/用戶#新
settings /settings(.:format) users#settings
users GET /users(.:format) users#index
POST /users(.:format) users#create
new_user GET /users/new(.:format) users#new
edit_user GET /users/:id/edit(.:format) users#edit
user GET /users/:id(.:format) users#show
PUT /users/:id(.:format) users#update
DELETE /users/:id(.:format) users#destroy
sessions GET /sessions(.:format) sessions#index
POST /sessions(.:format) sessions#create
new_session GET /sessions/new(.:format) sessions#new
edit_session GET /sessions/:id/edit(.:format)會話#編輯 會議GET /sessions/:id(.:format)會話#顯示 PUT /會話/:ID(。:格式)會話#更新 DELETE /sessions/:id(.:format)會話#破壞
你可以做 'get'settings'=>'settings#whatever'' 或 'resources:settings'。 不知道我是否正確理解你的問題。 – 2013-03-20 16:37:59
請問您能否提供'''rake routes'''的輸出? – 2013-03-20 19:54:46
我加耙路線 – pwz2000 2013-03-21 15:54:37