My rails app (3 with devise 2.2 and pg as DB) use Devise for authentication. The whole app require for user to be logged-in.
When a new user request
myapp.com/category/:c_id/product/:p_id/, devise redirect it to the register/log-in devise page.
Once the user is registered, he is redirected to the page he originally wanted to see (
myapp.com/category/:c_id/product/:p_id/) with the session variable(created by devise) "user_return_to".
Everything i just described is already working fine. Now i will explain what i'd like to do.
When the user register, i'd like to store the information that he wanted to access this or that product. I'm not sure how i should do that exactly.
Where should i put the code that will intercept user_return_to and add it to the user data during a registration?