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

  • SEARCH
  • Home
  • 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 3498470
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T12:29:37+00:00 2026-05-18T12:29:37+00:00

i am very new to rails . I am having a table holding all

  • 0

i am very new to rails . I am having a table holding all users basic information like

users(id,name,email)
now i am trying to keep some additional information of these users in a separate table like

user_details(id,user_id,additional_info)

I have created this user_details table . Now i try to keep some default records for checking . how to keep the hash value of the user’s additional details in the additional_info like if my additional details are user’s (designation,salary,prjtname) in the column additional_info of the User_details table.

Also what datatype i have to give for this additional_info column of the User_details table. Please give some suggestions ..

  • 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-18T12:29:38+00:00Added an answer on May 18, 2026 at 12:29 pm

    The data type for that column must be text so in your migrations you can specify:

    add_column :user_details, :additional_info, :text
    

    Then in your model you have to specify that this column will contain a hash and you do that with the serialize command:

    class UserDetail < ActiveRecord::Base
      serialize :additional_info
    

    After that you can save hash information.

    @ud = UserDetail.new
    @ud.additional_info = {:salary => 1000000}
    @ud.save
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to rails development so this is a very basic question. I'm working
I'm very new to Rails (and Ruby), and am having trouble installing and using
I am new to Rails and I'm I am trying to create a basic
I am very new to Rails so this will probably seem basic to most
(Disclaimer: I am very new to rails) This plugin looks like it will be
I'm new to rails and am having what I think is a very simple
Ok, so I was having some issues getting rails setup and I'm very new
I'm very new to rails but I really like how easy it is to
(Disclosure: I'm very new to Rails) I am trying to make a RISK-style board-game
I am new to Rails, and I was trying to deploy a very simple

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.