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 6208889
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T05:53:03+00:00 2026-05-24T05:53:03+00:00

I am RoR noob so this might be a simple problem for someone. I

  • 0

I am RoR noob so this might be a simple problem for someone. I have created two models – User and Feedback and I have two tables associated with them. users and feedbacks.

Now I want to create a relationship table with user_id as one column and feeback_id as the other column.

Do I create a model or just a migration? I am confused.

Here are my user and feedback migrations.

class CreateUsers < ActiveRecord::Migration
def self.up
create_table :users do |t|
    t.string "first_name"
    t.string "last_name"
    t.string "email"
    t.string "phone"
    t.string "password_hashed"
    t.string "password_salt"
    t.boolean "isdeleted", :default => false
    t.timestamps
end
end

def self.down
drop_table :users
end
end

class CreateFeedbacks < ActiveRecord::Migration
def self.up
create_table :feedbacks do |t|
    t.text "feedback"
    t.integer "rating"  
    t.boolean "isdeleted", :default => false
    t.timestamps
end
end
def self.down
drop_table :feedbacks
end
end

Now do I create a model??? >rails generate model FeedbackUserJoinTable ? Or just a migration like this ??

class CreateFeedbackUserJoinTable < ActiveRecord::Migration
def change
create_table :feedbacks_users, :id => false do |t|
  t.integer :feedback_id
  t.integer :user_id
end
end
end
  • 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-24T05:53:03+00:00Added an answer on May 24, 2026 at 5:53 am

    You do not need to create a model. Just create the migration as you have written 🙂

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

Sidebar

Related Questions

Using RoR 2.3.8. I have two models. It's strange that when I typed text
I'm new to RoR/Gems, this is a basic question. I created a gem, MyNameGem,
Noob Alert. I am learning RoR, have Windows 7, so I downloaded the latest
I am new to ror. I have 2 tables for group (called 'ab') and
I'm beginning RoR. I've designed my model like this : User -login:string -password:string -email:string
Simple RoR question...I am learning ROR and am making a simple voting app. The
I have a RoR project on my Windows 7 PC. I want to create
RoR/SQL newbie here. My datetime column ' deleted_at ' are all uninitialized. Running this
Background I have a ror application which is continuously recording and showing on a
i have an RoR application Log, which similar to the book store app, my

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.