Unused methods in user controller disabled

This commit is contained in:
Christoph Haas 2017-04-19 13:07:33 +02:00
parent dab415da0e
commit 11ae4e6d66

View file

@ -2,42 +2,42 @@ class UsersController < ApplicationController
before_action :require_user, :only => [:show, :edit, :update]
def new
@user = User.new
end
def create
@user = User.new(params[:user])
# Saving without session maintenance to skip
# auto-login which can't happen here because
# the User has not yet been activated
if @user.save
flash[:notice] = "Your account has been created."
redirect_to signup_url
else
flash[:notice] = "There was a problem creating you."
render :action => :new
end
end
def show
@user = current_user
end
def edit
@user = current_user
end
def update
@user = current_user # makes our views "cleaner" and more consistent
if @user.update_attributes(params[:user])
flash[:notice] = "Account updated!"
redirect_to account_url
else
render :action => :edit
end
end
# def new
# @user = User.new
# end
#
# def create
# @user = User.new(params[:user])
#
# # Saving without session maintenance to skip
# # auto-login which can't happen here because
# # the User has not yet been activated
# if @user.save
# flash[:notice] = "Your account has been created."
# redirect_to signup_url
# else
# flash[:notice] = "There was a problem creating you."
# render :action => :new
# end
#
# end
#
# def show
# @user = current_user
# end
#
# def edit
# @user = current_user
# end
#
# def update
# @user = current_user # makes our views "cleaner" and more consistent
# if @user.update_attributes(params[:user])
# flash[:notice] = "Account updated!"
# redirect_to account_url
# else
# render :action => :edit
# end
# end
end