Created
October 11, 2013 01:13
-
-
Save alexclarkofficial/6928158 to your computer and use it in GitHub Desktop.
User Controller
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UsersController < ApplicationController | |
def show | |
@user = User.find(params[:id]) | |
end | |
def new | |
@user = User.new | |
end | |
def create | |
@user = User.new(user_params) | |
if @user.save | |
flash[:success] = "Welcome to The Weekend!" | |
redirect_to @user | |
else | |
render 'new' | |
end | |
end | |
private | |
def user_params | |
params.require(:user).permit(:name, :email, :password, :password_confirmation) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment