I am using restful authentication and was wondering if anyone has had any experience with sub accounts. Basically, I want a user to have the ability to add another user(s) to his/her account. So if user A creates an account I would like them to have the ability to add new users to their account - B, C, etc. B and C would "belong" to A and if A''s account is deleted so is B and C. Makes sense? Any information on how to achieve this would be greatly appreciated. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
mlittle wrote:> I am using restful authentication and was wondering if anyone has had > any experience with sub accounts. Basically, I want a user to have the > ability to add another user(s) to his/her account. So if user A > creates an account I would like them to have the ability to add new > users to their account - B, C, etc. B and C would "belong" to A and if > A''s account is deleted so is B and C. Makes sense? Any information on > how to achieve this would be greatly appreciated.This can be done by using the relationships among the tables. I suggest the following database model: Users ( Table ) ----- ID Name sub_users ( Table) ID references Users(ID) UserID In the models Users => has_many :sub_users sub_users => belongs_to :User so, you should delete first sub_users records, then Users table records. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Mar 21, 10:33 pm, Loganathan Ganesan <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> mlittle wrote: > > I am using restful authentication and was wondering if anyone has had > > any experience with sub accounts. Basically, I want a user to have the > > ability to add another user(s) to his/her account. So if user A > > creates an account I would like them to have the ability to add new > > users to their account - B, C, etc. B and C would "belong" to A and if > > A''s account is deleted so is B and C. Makes sense? Any information on > > how to achieve this would be greatly appreciated. > > This can be done by using the relationships among the tables. > I suggest the following database model: > > Users ( Table ) > ----- > > ID > Name > > sub_users ( Table) > > ID references Users(ID) > UserID > > In the models > > Users => has_many :sub_users > sub_users => belongs_to :User > > so, you should delete first sub_users records, then Users table records. > -- > Posted viahttp://www.ruby-forum.com/.Seems too easy :). How would I handle the confirmation email and related issues? Thanks a bunch for the response. I do appreciate it!! -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
mlittle wrote:> On Mar 21, 10:33�pm, Loganathan Ganesan <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: >> I suggest the following database model: >> UserID >> >> In the models >> >> Users � => has_many :sub_users >> sub_users => belongs_to :User >> >> so, you should delete first sub_users records, then Users table records. >> -- >> Posted viahttp://www.ruby-forum.com/. > > Seems too easy :). How would I handle the confirmation email and > related issues? Thanks a bunch for the response. I do appreciate it!!I don''t really understand what are you trying to mean about confirmation email and related issues ? If u don''t mind can u explain me in detail? Thanks -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Mar 21, 10:46 pm, Loganathan Ganesan <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> mlittle wrote: > > On Mar 21, 10:33 pm, Loganathan Ganesan <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: > >> I suggest the following database model: > >> UserID > > >> In the models > > >> Users => has_many :sub_users > >> sub_users => belongs_to :User > > >> so, you should delete first sub_users records, then Users table records. > >> -- > >> Posted viahttp://www.ruby-forum.com/. > > > Seems too easy :). How would I handle the confirmation email and > > related issues? Thanks a bunch for the response. I do appreciate it!! > mo > I don''t really understand what are you trying to mean about confirmation > email and related issues ? > If u don''t mind can u explain me in detail? > > Thanks > -- > Posted viahttp://www.ruby-forum.com/.I''m going to look at the code more but I was talking about creating the user just like I would with restful_authentication. I see what you are saying but I am still not clear how the new user in sub_user would be able to login, logout, and basically do the same as the users in Users. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Anyone else able to provide me with some insight on implementing this? On Mar 21, 10:55 pm, mlittle <mdlit...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Mar 21, 10:46 pm, Loganathan Ganesan <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: > > > > > mlittle wrote: > > > On Mar 21, 10:33 pm, Loganathan Ganesan <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: > > >> I suggest the following database model: > > >> UserID > > > >> In the models > > > >> Users => has_many :sub_users > > >> sub_users => belongs_to :User > > > >> so, you should delete first sub_users records, then Users table records. > > >> -- > > >> Posted viahttp://www.ruby-forum.com/. > > > > Seems too easy :). How would I handle the confirmation email and > > > related issues? Thanks a bunch for the response. I do appreciate it!! > > mo > > I don''t really understand what are you trying to mean about confirmation > > email and related issues ? > > If u don''t mind can u explain me in detail? > > > Thanks > > -- > > Posted viahttp://www.ruby-forum.com/. > > I''m going to look at the code more but I was talking about creating > the user just like I would with restful_authentication. I see what you > are saying but I am still not clear how the new user in sub_user would > be able to login, logout, and basically do the same as the users in > Users.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.