ruby on rails - Devise Registration Form -


i have 2 devise forms used in ruby on rails site...how can set different route paths both devise form..i tried override after_sign_up_path..but both forms gets redirected same path...

i want set different paths each form.

registrations controller

class registrations controller < devise::registrations controller   protected    def after_sign_up_path_for(resource)     'root_path'   end end 

this method calls when signup success, set after signed path here

 def after_sign_up_path_for(resource)       if resource.invitation_type == "first" (please replace actual invitation type here)         user1_path(replace actual path)        elsif resource.invitation_type == "second" (please replace actual invitation type here)        user2_path(replace actual path)       else         root_path       end     end 

hope helps!


Comments

Popular posts from this blog

c++ - How to add Crypto++ library to Qt project -

jQuery Mobile app not scrolling in Firefox -

How to use vim as editor in Matlab GUI -