Мой логин работал нормально, но я не знаю, где я все испортил. Когда я захожу, он перенаправляет мне сессии / пользователя, что неправильно. Вот ошибка:
No route matches [POST] "/sessions/user"
Вот мои маршруты.рб:
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