Class: Decidim::Devise::InvitationsController

Inherits:
Devise::InvitationsController
  • Object
show all
Includes:
LocaleSwitcher, NeedsOrganization
Defined in:
app/controllers/decidim/devise/invitations_controller.rb

Overview

This controller customizes the behaviour of Devise::Invitiable.

Instance Method Summary collapse

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.



21
22
23
# File 'app/controllers/decidim/devise/invitations_controller.rb', line 21

def after_accept_path_for(resource)
  params[:invite_redirect] || (resource)
end

#authenticate_inviter!Object

We don’t users to create invitations, so we just redirect them to the homepage.



14
15
16
# File 'app/controllers/decidim/devise/invitations_controller.rb', line 14

def authenticate_inviter!
  redirect_to root_path
end