summaryrefslogtreecommitdiff
path: root/app/controllers/users_controller.rb
diff options
context:
space:
mode:
authorDavisLWebb <davislwebb@ymail.com>2014-03-02 17:53:03 -0500
committerDavisLWebb <davislwebb@ymail.com>2014-03-02 17:53:03 -0500
commit2005734a8ea64cd29d681db81c2bec45c64023b6 (patch)
tree31b5c1c8f7df84753d6f93b86a8e4811ab00785e /app/controllers/users_controller.rb
parent7d84062ebe272855c0e6ebbfd991ab277fdc079f (diff)
Added Session controller and helper. Also update user to have a remember_token
Diffstat (limited to 'app/controllers/users_controller.rb')
-rw-r--r--app/controllers/users_controller.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index f4e1499..24d319a 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -3,6 +3,17 @@ class UsersController < ApplicationController
def new
end
+ def create
+ @user = User.new(user_params)
+ if @user.save
+ sign_in @user
+ flash[:success] = "Welcome to the Sample App!"
+ redirect_to @user
+ else
+ render 'new'
+ end
+ end
+
def show
@user = User.find(param[:id])
end