AlwaysCharging
2009-Nov-11 01:05 UTC
What can go into the User model to allow users to have profiles?
I''m learning Rails and still a little unclear as to what goes where. In my app I want to have Users (which I''ll probably use restful_authentication or authlogic). So I set up my Users model (which I can follow), but how do I allow users to have "profile" pages for pics, about me''s, and blog posts for that user? Would that be set up in another model then tied back to the Users model? Or, could a user''s profile be enabled directly in the User model? (I don''t think so because the User has some sensitive information in it (email, password) and it''s not a good idea to put the two together, right?) So, how does everyone allow their Users to have profile pages? I''m sure there''s a lot of ways to do this, but whats the generally accepted, or most common, way to do this? A user model AND a profile model, which is tied to the user_id? Or is there a better way? Thank you for any and all input. It''s greatly appreciated. (side note: are there any screencasts that show how this is done? I''m still going through the railscasts, as well as some other screencasts I''ve found on various sites, so I might eventually find it. Just didn''t know if anybody knew of any offhand.)
Marnen Laibow-Koser
2009-Nov-11 01:32 UTC
Re: What can go into the User model to allow users to have p
AlwaysCharging wrote:> I''m learning Rails and still a little unclear as to what goes where. > > In my app I want to have Users (which I''ll probably use > restful_authentication or authlogic).Use Authlogic. Restful_authentication produces unmaintainable garbage.> So I set up my Users model > (which I can follow), but how do I allow users to have "profile" pages > for pics, about me''s, and blog posts for that user? Would that be set > up in another model then tied back to the Users model? Or, could a > user''s profile be enabled directly in the User model?Either could work. I think I''d lean toward the latter approach.> (I don''t think > so because the User has some sensitive information in it (email, > password) and it''s not a good idea to put the two together, right?)Not necessarily. Just make sure you''ve got things appropriately protected b> > So, how does everyone allow their Users to have profile pages?You''re asking a really general question that''s not amenable to a cookbook reply.> I''m > sure there''s a lot of ways to do this, but whats the generally > accepted, or most common, way to do this? A user model AND a profile > model, which is tied to the user_id? Or is there a better way? >Whatever works for your data model.> Thank you for any and all input. It''s greatly appreciated. > > (side note: are there any screencasts that show how this is done? I''m > still going through the railscasts, as well as some other screencasts > I''ve found on various sites, so I might eventually find it. Just > didn''t know if anybody knew of any offhand.)Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/.