i want generate unique url each user signs app. urls should lead same sign page each 1 associated 1 user received when signing up. every time new user signs through unique url, number of signups associated url increment one. therefore, can track number of signups generated each user. how build such system?
this ruby on rails app.
i not sure requirement is. if thinking of use case like: user invites not_yet_a_user_b. , b gets unique signup url. b clicks , register him self in site , site records in db b invited a.
you implement this.
have model (and underlying table) called invitations fields (invitation code:string, inviter_user_id:integer). user can have 1 (one 1 mapping.. oh can keep invitation code in user table) invitations. , in user model have field called invited_by_user_id:integer).
when send sign request b, like: www.site.com/signup?invitation_code=abc. in sign action can check invitation_code parameter , check against invitations table find out invited b. record user id in b's invited_by_user_id.
then can tell invited who. , how many people (and are) invited given user.
Comments
Post a Comment