-2
定製設計路線後,我遇到了一些路由問題。設計路由,定製問題定製設計路線
目前安裝(但沒有):
- /ME /帳戶負載設計::註冊#編輯表單
- /ME /帳號/:什麼路線account_controller#編輯
我的路線(快捷方式):
devise_for :users do
...
end
devise_scope :user do
scope "/me/account" do
get "/" => "users/registrations#edit", :as => :my_account
get "/:what" => "accounts#edit", :as => :my_account_edit
end
end
resources :accounts, :only => [:edit, :update]
耙路輸出:
activate_account GET /reactivate(.:format) users#reactivate
my_account GET /me/account(.:format) users/registrations#edit
my_account_edit GET /me/account/:what(.:format) accounts#edit
cancel GET /me/account/cancel(.:format) users/registrations#cancel
DELETE /me/account(.:format) users/registrations#destroy
edit_account GET /accounts/:id/edit(.:format) accounts#edit
account PATCH /accounts/:id(.:format) accounts#update
PUT /accounts/:id(.:format) accounts#update
帳戶
因爲/我/帳戶實際上是顯示註冊#編輯(設計)和所有的/我/帳號/ helpme是自定義表單字段
這有問題:
- 更新或失敗時沒有在/我/帳戶上顯示的通知
- 失敗時,表單不會填入之前填寫的表單值 和
- 它沒有更新的形式
/ME /帳號/ helpme推移,在表單提交,到/客戶/ 1(當前用戶ID)和拋出錯誤
沒有路由匹配{:動作=>」編輯」:控制器=> 「賬戶」,:ID => 「1」,什麼=>零}缺少必需的鍵:[:什麼]
這些問題是完全讓我瘋狂。任何人都可以提供一些建議來解決(一個或多個)這些路由問題?
對不起,這只是超級混亂。我不知道從哪裏開始回答你的問題。 – phoet