andkjaer
andkjaer

Reputation: 4065

Rails Devise invitable redirect

Im playing around with the Devise invitable gem: https://github.com/scambra/devise_invitable

It's working fine.

But how do i redirect to a specific page on a successful invitation?

Upvotes: 5

Views: 3203

Answers (2)

Paul
Paul

Reputation: 116

From the devise invitable readme:

After an invitation is accepted, the invitee will be redirected to after_accept_path_for(resource), which is the same path as after_sign_in_path_for by default. If you want to override the path, override invitations controller and define after_accept_path_for method. This is useful in the common case that a user is invited to a specific location in your application. More on Devise's README, "Controller filters and helpers" section.

Upvotes: 9

Bjorn
Bjorn

Reputation: 5362

Since devise_invitable is based upon devise, I guess you can use this:

https://github.com/plataformatec/devise/wiki/How-To:-Redirect-to-a-specific-page-on-successful-sign-in

Upvotes: 0

Related Questions