Skip to content

Instantly share code, notes, and snippets.

@alexclarkofficial
Created October 11, 2013 01:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexclarkofficial/6928158 to your computer and use it in GitHub Desktop.
Save alexclarkofficial/6928158 to your computer and use it in GitHub Desktop.
User Controller
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