Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6376931
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:48:24+00:00 2026-05-25T01:48:24+00:00

I am creating a Ruby on Rails website. The users can have avatars from

  • 0

I am creating a Ruby on Rails website. The users can have avatars from a limited set of avatars I provide, like turntable.fm. and again like Turntable.fm depending on the uses rank they can pick different avatars from different levels.

I am thinking of creating the avatar with scaffold, so have an MVC for it.

rails generate scaffold avatar file_name:string, level:integer

(for non ruby experts 😉 ) So my avatar mysql table would have id, file_name and level as it’s columns.

and also add a avatar_id to the User table.

I am wondering is this the right way to address this problem?
I was just reading about BLOB and storing images in the database, do I need to do anything like that?

Thanks!
Mina

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T01:48:24+00:00Added an answer on May 25, 2026 at 1:48 am

    It depends on how many avatar images you have, if they are not tens of thousand or more doing it the way you suggest should be ok, otherwise make sure you read this question.

    Then another question is, do you want to have it future proof just in case the requirements change in a big way, for instance in order to support custom avatars. In this case you would probably need something more in the table, say the path to the directory the file will get saved in.

    Also it’s disputable whether you need a file_name column for this, you could just as well use avatar_id as a filename. Maybe you’ll need a name/label for the avatar, but it is not required to name the file like that, and it’s best not to actually do it (thinking about i18n over here, special characters but not only that)

    Then as already mentioned, you could try save the file itself in the database if you think there are any advantages to it (I wouldn’t do it myself, but there are valid pro arguments for going this way, see here for a discussion on the subject)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating a website in Ruby on Rails, where users can login using RESTful
I have been creating a website with Ruby on Rails, and will be hosting
I am creating a website in Ruby on Rails. I have a controller action
I'm creating a Ruby on Rails application, and I'm trying to create/login/logout users. This
I want to automate things like: Creating a new Ruby on Rails application with
I tried creating a DB migration in Rails that looked something like this: ruby
I created a Ruby on Rails application (2.3.9) where users can record workouts. I
I have built a Ruby on Rails (2.3.8) application that allows users to track
I want to learn Ruby on Rails and have set up a test environment.
I'm creating a fast application with ruby on rails, and after doing a lot

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.