user and session generated
This commit is contained in:
parent
0cec39413f
commit
53819e6839
18 changed files with 111 additions and 0 deletions
10
app/controllers/sessions_controller.rb
Normal file
10
app/controllers/sessions_controller.rb
Normal file
|
@ -0,0 +1,10 @@
|
|||
class SessionsController < ApplicationController
|
||||
def new
|
||||
end
|
||||
|
||||
def create
|
||||
end
|
||||
|
||||
def welcome
|
||||
end
|
||||
end
|
10
app/controllers/users_controller.rb
Normal file
10
app/controllers/users_controller.rb
Normal file
|
@ -0,0 +1,10 @@
|
|||
class UsersController < ApplicationController
|
||||
def new
|
||||
end
|
||||
|
||||
def create
|
||||
@user = User.create(params.require(:user).permit(:username, :password))
|
||||
session[:user_id] = @user.id
|
||||
redirect_to '/welcome'
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue