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

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - Bypass Geo Redirect for specific directories -

php - .htaccess mod_rewrite for dynamic url which has domain names -