7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/generators/authkit/templates/app/controllers/email_confirmation_controller.rb', line 7
def show
if current_user.email_confirmed
flash[:notice] = "Thanks for confirming your email address"
respond_to do |format|
format.json { head :no_content }
format.html { redirect_to root_path }
end
else
respond_to do |format|
format.json { render json: { status: 'error', errors: current_user.errors }.to_json, status: 422 }
format.html {
flash[:error] = "Could not confirm email address because it is already in use"
redirect_to root_path
}
end
end
end
|