Unused methods in user controller disabled
This commit is contained in:
parent
dab415da0e
commit
11ae4e6d66
1 changed files with 37 additions and 37 deletions
|
|
@ -2,42 +2,42 @@ class UsersController < ApplicationController
|
||||||
|
|
||||||
before_action :require_user, :only => [:show, :edit, :update]
|
before_action :require_user, :only => [:show, :edit, :update]
|
||||||
|
|
||||||
def new
|
# def new
|
||||||
@user = User.new
|
# @user = User.new
|
||||||
end
|
# end
|
||||||
|
#
|
||||||
def create
|
# def create
|
||||||
@user = User.new(params[:user])
|
# @user = User.new(params[:user])
|
||||||
|
#
|
||||||
# Saving without session maintenance to skip
|
# # Saving without session maintenance to skip
|
||||||
# auto-login which can't happen here because
|
# # auto-login which can't happen here because
|
||||||
# the User has not yet been activated
|
# # the User has not yet been activated
|
||||||
if @user.save
|
# if @user.save
|
||||||
flash[:notice] = "Your account has been created."
|
# flash[:notice] = "Your account has been created."
|
||||||
redirect_to signup_url
|
# redirect_to signup_url
|
||||||
else
|
# else
|
||||||
flash[:notice] = "There was a problem creating you."
|
# flash[:notice] = "There was a problem creating you."
|
||||||
render :action => :new
|
# render :action => :new
|
||||||
end
|
# end
|
||||||
|
#
|
||||||
end
|
# end
|
||||||
|
#
|
||||||
def show
|
# def show
|
||||||
@user = current_user
|
# @user = current_user
|
||||||
end
|
# end
|
||||||
|
#
|
||||||
def edit
|
# def edit
|
||||||
@user = current_user
|
# @user = current_user
|
||||||
end
|
# end
|
||||||
|
#
|
||||||
def update
|
# def update
|
||||||
@user = current_user # makes our views "cleaner" and more consistent
|
# @user = current_user # makes our views "cleaner" and more consistent
|
||||||
if @user.update_attributes(params[:user])
|
# if @user.update_attributes(params[:user])
|
||||||
flash[:notice] = "Account updated!"
|
# flash[:notice] = "Account updated!"
|
||||||
redirect_to account_url
|
# redirect_to account_url
|
||||||
else
|
# else
|
||||||
render :action => :edit
|
# render :action => :edit
|
||||||
end
|
# end
|
||||||
end
|
# end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue