我正在做Michael Hartl的Rails教程的第7章,并且在尝试注册开发中的用户时出现错误。我已经完成了7.3章节,所以我的所有测试都应该现在通过,但我仍然在收到The action 'create' could not be found for UsersController
的开发。无法为UsersController找到操作'create'
这里是我的用户控制器
class UsersController < ApplicationController
def show
@user = User.find(params[:id])
end
def new
@user = User.new
def create
@user = User.new(user_params)
if @user.save
flash[:success] = "Welcome to the Sample App!"
redirect_to @user
else
render 'new'
end
end
def user_params
params.require(:user).permit(:name, :email, :password,
:password_confirmation)
end
end
end
在本教程这一点我应该能够登录在线形式提供给用户时没有问题。这是我的github仓库https://github.com/ajhausdorf/sample_app