Skip to content

Commit

Permalink
Redirect to new profile path after sign up and show a message (#175)
Browse files Browse the repository at this point in the history
* add devise registrations controller and message
  • Loading branch information
varkum authored Jan 18, 2024
1 parent d647534 commit 7d69b5d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions app/controllers/registrations_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# frozen_string_literal: true

# Define redirect route after registration for devise
class RegistrationsController < Devise::RegistrationsController
protected

def after_sign_up_path_for(_resource)
new_profile_path
end
end
2 changes: 1 addition & 1 deletion config/locales/devise.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ en:
updated_not_active: "Your password has been changed successfully."
registrations:
destroyed: "Bye! Your account has been successfully cancelled. We hope to see you again soon."
signed_up: "Welcome! You have signed up successfully."
signed_up: "Welcome! You have signed up successfully. Fill out your profile to start attending events!"
signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated."
signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked."
signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please follow the link to activate your account."
Expand Down
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Rails.application.routes.draw do
root "support#about"

devise_for :users
devise_for :users, controllers: { registrations: "registrations" }

resources :events
resources :event_attendees
Expand Down

0 comments on commit 7d69b5d

Please sign in to comment.