ruby on rails - Devise Redirect After Cancellation -
i want redirect customers survey after cancel subscription, having difficult time getting session destroyed along redirecting survey.
organizations_controller.rb:
def cancel if @organization.subscription.cancel redirect_to "http://example.com/contact/cancel?organization=#{@organization.resource_id}" else flash[:error] = "an error has occurred." redirect_to settings_profile_path end end
how can utilize devise destroy_user_session_path
, redirect suvery @ same time without overriding redirect path of normal user signing out. need work when organization cancels.
i don't quite understand question. want destroy session logging out user? if so, try this: in application controller add private method
def after_sign_out_path_for(user) if blah redirect_to :foo else redirect_to :bar end end
Comments
Post a Comment