我要做的是在登录/注册后转到用户页面。在错误页面上写着错误在 users_controller 中。所以这是我的用户控制器:
class UsersController < ApplicationController
def show
@user = User.find([:id])
end
def index
end
def new
end
def new
@user = User.new
end
def create
@user = User.new(user_params)
if @user.save
# Handle a successful save.
else
render 'new'
end
end
private
def user_params
params.require(:user).permit(:name, :email, :password,
:password_confirmation)
end
end