Rails Create Attractive Redirects

I play with a ghost gem: https://github.com/scambra/devise_invitable

It works great.

But how to redirect to a specific page in a successful invitation?

+4
source share
2 answers

From inventing an invitable readme :

After the invitation is accepted, the invitee will be redirected to after_accept_path_for (resource) , which by default matches the after_sign_in_path_for parameter. If you want to redefine the path, redefine the invitation controller and define the after_accept_path_for method. This is useful in the general case when a user is invited to a specific place in your application. Learn more about Devise README, the "Filters and Helper Controllers" section.

+8
source

Since devise_invitable is development-based, I think you can use this:

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

+1
source

Source: https://habr.com/ru/post/1334937/


All Articles