22 lines
315 B
Ruby
22 lines
315 B
Ruby
|
class UsersController < ApplicationController
|
||
|
def new
|
||
|
@user = User.new
|
||
|
end
|
||
|
|
||
|
def create
|
||
|
@user = User.new(user_params)
|
||
|
|
||
|
if @user.save
|
||
|
render :create
|
||
|
else
|
||
|
render :new
|
||
|
end
|
||
|
end
|
||
|
|
||
|
private
|
||
|
|
||
|
def user_params
|
||
|
params.require(:user).permit(:username, :password, :email)
|
||
|
end
|
||
|
end
|