I stumbled upon your question because I had the same problem. As far as I can tell you how to override after_invite_path_for you need to override Devise :: InvitationsController.
class Users::InvitationsController < Devise::InvitationsController def after_invite_path_for(resource) new_profile_path end end
routes.rb
devise_for :users, :controllers => { :invitations => "users/invitations" }
It would be nice if deviz invitable worked as your own, and you could override it after inviting / accepting the paths in the application controller. I modified devise_invitable to work this way and sent a pull request. I'm not sure if this will be accepted or not, but you can look here: https://github.com/scambra/devise_invitable/pull/240 .
If this function is accepted, you can fix your current version of invitable to respect the definitions after inviting / accepting paths in the application controller by placing it in the initializer:
#make invitable path functions overridable in application controller [:after_invite_path_for, :after_accept_path_for].each do |method| Devise::InvitationsController.send(:remove_method, method) if ApplicationController.method_defined? method end
source share