From 97e1ce858e18b020f78ce8b0980f36a27c0b056b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=83=8A=E5=9D=A4?= Date: Mon, 23 Nov 2015 14:13:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=94=A8=E6=88=B7=E6=B3=A8?= =?UTF-8?q?=E5=86=8C=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index dbcde11..2f405da 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1,10 +1,19 @@ #encoding: utf-8 class UsersController < ApplicationController def register + @user = User.new + render 'register', layout: 'register' end def register_confirm + @user = User.new params.require(:user).permit(:username,:em ail,:password,:password_confirmation) + if @user.save + to_login @user + redirect_to root_path + else + render 'register', layout: 'register' + end end @@ -25,4 +34,4 @@ class UsersController < ApplicationController def to_login(user) end -end \ No newline at end of file +end