在达到某些路线后设计用户

时间:2011-11-05 18:32:59

标签: ruby-on-rails devise

这是我的路线档案:

Tubalr::Application.routes.draw do
  devise_for :users

  root :to => "application#index"

  get "/player/:search_type/:search/:first_video" => "application#player"

  get "/just/:artist_band.json" => "api#just"
  get "/similar/:artist_band.json" => "api#similar"
  get "/:username/favorites.json" => "api#userFavorites"

  get "/just/:artist_band" => "application#index"
  get "/similar/:artist_band" => "application#index"

  get "/history" => "application#history"

  get "/:username/favorites" => "favorites#init"

  post "/check-favorites" => "favorites#check"
  post "/favorites/add" => "favorites#add"
  post "/favorites/remove" => "favorites#remove"  

  devise_scope :user do
    get "/users/sign_out" => "devise/sessions#destroy"
  end
end

设备的路由/history和默认/users/edit路由不会将用户注销。

我不确定要提供哪些其他信息,如果有什么能帮助调试我的问题,请告诉我,我会更新问题。

可以在此处找到整个项目代码:https://github.com/cjstewart88/Tubalr/tree/user_favorites

1 个答案:

答案 0 :(得分:1)

在挖掘之后我终于碰到了这个:

https://github.com/plataformatec/devise/issues/913

似乎csrf令牌需要与AJAX请求一起传递,我的应用程序正在做很多事情。