2012-02-15 8 views
1

ログインはうまくいっていますが、どこがうまくいけないのか分かりません。私がログインすると、間違っているセッション/ユーザがリダイレクトされます。ここでエラーがある:ここではRails 3.1突然すべてが間違ったパスにリダイレクトされる

No route matches [POST] "/sessions/user" 

は私のroutes.rbを次のとおりです。

Wal::Application.routes.draw do 

resources :sessions, :only => [:new, :create, :destroy] 



devise_for :users, :skip => [:sessions] 

devise_for :users do get '/users/sign_out' => 'devise/sessions#destroy' end 

resources :posts do 
resources :comments 
end 
resources :users, :only => [:show] 
resources :microsposts, :only => [:create, :destroy] 
match '/' => "home#index", :as => :home 

match 'home/index', :to => 'home#index' 

get "users/show" 

root :to => "home#index" 
#get "home/index" 

resources :users do 
    member do 
    get :following, :followers 
    end 
end 

resources :microsposts, :only => [:create, :destroy] 
resources :relationships, :only => [:create, :destroy] 

アプリケーションコントローラ:

class ApplicationController < ActionController::Base 
    protect_from_forgery 

    def after_sign_in_path_for(resource) 
    current_user # <- Path you want to redirect the user to after signup 
    end 
    def after_sign_up_path_for(resource) 
    current_user 
    end 
+0

考案のバージョンのようなものを試してみてください? – John

答えて

0

が、これはあなたの問題を解決する場合は知っているが、最初にしないでください行:

Wal::Application.routes.draw do

は対応していませんあなたが投稿したコードに「終わり」があります。

+0

私は二重チェックしました、私は、私はちょうどそれをコピーしていない。コメント – user1191343

関連する問題