我跟着发生了,这是我的用户控制器
class UserController < 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
在我的 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 :user
resources :user do
#resources :car
end
当我在浏览器上运行它时,我得到了这个:
Routing Error
No route matches {:action=>"show", :controller=>"user"}
Try running rake routes for more information on available routes.
不知道为什么会这样???