creddit/app/controllers/users_controller.rb

22 lines
324 B
Ruby
Raw Normal View History

2015-07-08 15:17:37 -04:00
class UsersController < ApplicationController
def new
@user = User.new
end
def create
@user = User.new(user_params)
if @user.save
2015-07-10 00:19:01 -04:00
redirect_to signin_path
2015-07-08 15:17:37 -04:00
else
render :new
end
end
private
def user_params
params.require(:user).permit(:username, :password, :email)
end
end