Class: Decidim::Devise::InvitationsController
- Inherits:
-
Devise::InvitationsController
- Object
- Devise::InvitationsController
- Decidim::Devise::InvitationsController
- Includes:
- Decidim::DeviseControllers
- Defined in:
- app/controllers/decidim/devise/invitations_controller.rb
Overview
This controller customizes the behaviour of Devise::Invitiable.
Instance Method Summary collapse
-
#after_accept_path_for(resource) ⇒ Object
Overwrite the method that returns the path after a user accepts an invitation.
-
#authenticate_inviter! ⇒ Object
We don’t users to create invitations, so we just redirect them to the homepage.
Instance Method Details
#after_accept_path_for(resource) ⇒ Object
Overwrite the method that returns the path after a user accepts an invitation. Using the param ‘invite_redirect` we can redirect the user to a custom path after it has accepted the invitation.
18 19 20 |
# File 'app/controllers/decidim/devise/invitations_controller.rb', line 18 def after_accept_path_for(resource) params[:invite_redirect] || after_sign_in_path_for(resource) end |
#authenticate_inviter! ⇒ Object
We don’t users to create invitations, so we just redirect them to the homepage.
11 12 13 |
# File 'app/controllers/decidim/devise/invitations_controller.rb', line 11 def authenticate_inviter! redirect_to root_path end |