Sha256: 0a902f761bf6e1365d8a55834c58f7aa968bcecdee2630915f0fcad85dd959f6
Contents?: true
Size: 886 Bytes
Versions: 10
Compression:
Stored size: 886 Bytes
Contents
class UsersController < ApplicationController before_action :set_user, :only => :finish_signup before_filter :authenticate_user!, :except => :finish_signup def show @user = current_user end def finish_signup if request.patch? && params[:user] #&& params[:user][:email] if current_user.update(user_params) # current_user.skip_reconfirmation! sign_in(current_user, :bypass => true) redirect_to current_user, notice: 'Your profile was successfully updated.' else @show_errors = true end end end private def set_user @user = User.find(params[:id]) end def user_params accessible = [ :name, :email ] # extend with your own params accessible << [ :password, :password_confirmation ] unless params[:user][:password].blank? params.require(:user).permit(accessible) end end
Version data entries
10 entries across 10 versions & 1 rubygems