My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

Where do I put User profile details in a Rails application?

Indu Pillai's photo
Indu Pillai
·Sep 28, 2017

I'm creating a simple Rails application with Sign Up, Log In and Log out functionality using has_secure_password and bcrypt gem.

I then want to display profiles of this user and other users. What is the best way to implement it?

I have two ways in my mind.

  1. Add everything to the User model together with the email and username.
  2. Add another model called profile (and a table called profiles) and add all the data not related to the authentication to that and display it on the profile pages.

Which of these two methods is the best, and will later work better with caching and scalability etc.

Thank You!