我收到了 2 条不同的消息,但出现了同样的错误,我正在为用户使用设计……这是我的 routes.rb
Estaciones::Application.routes.draw do
root :to => "static_pages#home"
match '/contact', :to=>'static_pages#contact'
match '/about', :to=>'static_pages#about'
devise_for :users
resources :users
就像我的 routes.rb 一样,我得到了下一个错误
uninitialized constant UsersController
Try running rake routes for more information on available routes.
但是如果删除“资源:用户”,我会收到以下错误
No route matches [GET] "/users/27"
我把我的用户控制器
class UsersController < ApplicationController
def new
@user = User.new
end
def create
@user = User.new(params[:user])
if @user.save
redirect_to user_session_path
else
redirect_to new_user_session_path
end
end
def show
@user = User.find(params[:id])
#redirect_to @user
end
end