[英]How can I nest resource using rails and devise
我正在嘗試將跟蹤系統添加到我的Rails應用程序中。 我嘗試了這段代碼:
devise_for:users,跳過::all與:user do
資源:user do成員確實得到:following,:followers end end#在這里,我放置了自定義路線
結束
並且我得到一個錯誤,該用戶資源已被定義。 當我像這樣刪除用戶資源時
devise_for:users,跳過::all與:user do
成員確實得到:關注,:關注者結束
#在這里我結束了自定義路線
我得到“成員必須嵌套在資源下”。 錯誤。 我試過添加:path =>“ accounts”,但是沒有用。 有任何想法嗎?
我建議添加與Devise無關的路線。 Devise專注於身份驗證,您的目標與身份驗證無關。
devise_for :users
resources :users do
member do
get :following
get :followers
end
end
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.