diff options
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/application_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/users_controller.rb | 11 |
2 files changed, 12 insertions, 1 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 03ef797..01058e3 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -4,6 +4,6 @@ class ApplicationController < ActionController::Base protect_from_forgery with: :exception #include sessionhelper for the session controller and view - include SessionHelper + include SessionsHelper end 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 |