Class: UsersController

Inherits:
ApplicationController show all
Defined in:
app/controllers/users_controller.rb

Instance Method Summary collapse

Methods included from SessionsHelper

#current_user, #log_in, #log_out, #logged_in?

Instance Method Details

#createObject


6
7
8
9
10
11
12
13
14
15
16
# File 'app/controllers/users_controller.rb', line 6

def create
  @user = User.new(user_params)

  if @user.save
    flash[:success] = "Welcome"
     @user
    redirect_to root_path
  else
    render "new"
  end
end

#newObject


2
3
4
# File 'app/controllers/users_controller.rb', line 2

def new
  @user = User.new
end