2013-05-26 154 views
1

即時通訊設備與註銷出現問題,當我嘗試註銷時,它獲得以下錯誤消息,其尋找用戶與id = sign_out。有什麼建議麼?註冊與設計不起作用

ActiveRecord::RecordNotFound in UsersController#show 

Couldn't find User with id=sign_out 

路線

devise_for :users 

    match 'users/settings', to: 'users#settings' 

    resources :users, only: [:show, :update] 

鏈接

<%= link_to 'Logout', destroy_user_session_path, :method => :delete %> 

耙路線

new_user_session GET /users/sign_in(.:format)       devise/sessions#new 
      user_session POST /users/sign_in(.:format)       devise/sessions#create 
    destroy_user_session DELETE /users/sign_out(.:format)       devise/sessions#destroy 
      user_password POST /users/password(.:format)       devise/passwords#create 
     new_user_password GET /users/password/new(.:format)      devise/passwords#new 
     edit_user_password GET /users/password/edit(.:format)     devise/passwords#edit 
         PUT /users/password(.:format)       devise/passwords#update 
cancel_user_registration GET /users/cancel(.:format)       devise/registrations#cancel 
     user_registration POST /users(.:format)         devise/registrations#create 
    new_user_registration GET /users/sign_up(.:format)       devise/registrations#new 
    edit_user_registration GET /users/edit(.:format)        devise/registrations#edit 
         PUT /users(.:format)         devise/registrations#update 
         DELETE /users(.:format)         devise/registrations#destroy 
      users_settings  /users/settings(.:format)       users#settings 
        user GET /users/:id(.:format)        users#show 
         PUT /users/:id(.:format) 
+0

你解決了嗎?具有與軌道完全相同的問題4 – Anchor

+0

不好意思看看我的舊代碼,但無法弄清楚我必須改變它的工作。我所能記得的是我改變了我的devise_for:users和match'users/settings'的順序,以:'users#settings'在我的路線文件中:( – Pierre

回答

0

確保你實際上點擊正確的鏈接。我高度懷疑鏈接將請求路由到UsersController#showdestroy_user_session_path路線到/users/sign_out所以這是不可能的。

+0

我查看了啓動get請求的終端,所以我改變了config.sign_out_via =:刪除到:得到,現在它工作....:/ – Pierre

1

最近我已經解決了這個問題,你需要儘量把或檢查以下線在你的意見/佈局/ application.html.erb

<%= javascript_include_tag "application" %>

還要檢查,如果你在有jquery_ujs你的Gemfile。