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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:59:34+00:00 2026-06-10T20:59:34+00:00

Ive finished Learning Rails 3 by O’Really, and now its time to experiment knowledge

  • 0

Ive finished Learning Rails 3 by O’Really, and now its time to experiment knowledge on a real project and I’ll be deploying to Red Hat’s OpenShift platform.
Searching trough my laptop code projects folder, I came out with a simple TODO task manager ive wrote once in C++. So it would be a good idea to bring that project back to life, this time as a web task managing service in Rails, allowing auth with OmniAuth.

The original C++ project was planned on a OOP point of view. You could create a “Task” object with its current ID number, Text string, Date ,and Time.
Every part of a task was made as a different C++ class. Eash one cointains its validation on the constructor.
And then saved the tasks to sqlite or exporting them as a plain text that you could share or read again on the app.

So, back to business, I’m trying to adapt that little app into something more complex in Rails using MVC.

I thought about adding a Scaffolding that brings the form to fill the task’s text field and pass it to the Controller.
The controller will set current date and time, and ID is set by default when saving to the DB.
Validations should go on the model, and I’ll create a migration to build a table upon that fields.
As I’ll be adding multiuser support with OmniAuth, (so every user could save his own tasks), I should create a new DB table, with users info.

But should I create a new task table for each user, and then mapping them to the users table?
Or just create one task table and drop every user’s tasks in there and then mapping all there?

I cant figure out a good with saving user tasks to the db.

Any ideas?

Thanks in advance

  • 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-06-10T20:59:36+00:00Added an answer on June 10, 2026 at 8:59 pm

    This is assuming that a User can have many tasks, but a Task can belong to only one user.

    You’ll have one tasks table and put all user’s tasks there.

    You’ll want to add a user_id column to the tasks table (rails g migration add_user_id_to_tasks user_id:integer) and add the following to the models –

    class Task < ActiveRecord::Base
      belongs_to :user
    end
    
    class User < ActiveRecord::Base
      has_many :tasks
    end
    

    Reference: Rails Guide to ActiveRecord Associations

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

Sidebar

Related Questions

I have been interested in learning Rails for some time now and feel now
I've nearly finished the development of a project and would like to test its
I've finished a personal project now just going through my code cleaning things up.
Ok so ive just finished my first JSF project and i want to upload
I've finished my current part-time project and am looking for something new. I've decided
I've finished my project in Eclipse en build the Java.jar file, it runs fine
I've just finished setting up a project using MVC 3, Fluent nHibernate, AutoMapper, and
I've just finished my Android widget. Now I need to have different sizes of
I've finished my poker game but now I want to make it look a
I've finished reading the spring doc and the PetClinic sample project. Just like to

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.