user.rb
has_one :company
My requirement is that when user sign up page is redirect to new company
form. How can I get sign up user id there?
Is it possible?
user.rb
has_one :company
My requirement is that when user sign up page is redirect to new company
form. How can I get sign up user id there?
Is it possible?
After signup devise gem login signup user if email not conformable so you can use current_user.id if for any reason you are not logged in after signup then login user and use current_user.id there
Put this code in application_controller.rb
def after_sign_up_path_for(resource)
sign_in resource
#your path #company path in your case
end
Devise provides an helper method "current_user", which store the information of sign_up user
you can use current_user.id