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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:49:35+00:00 2026-05-27T06:49:35+00:00

I am making a rails site where you can schedule an appointment for a

  • 0

I am making a rails site where you can schedule an appointment for a service. Currently I have an Appointment and Client model. Now I have decided that in order to get the Client’s information (name, email, etc) from an Appointment object, I would make an association between the two models. Now the way I see it, an Appointment should have_one client and a Client should have_many appointments. However, I have never seen an association between two model where they both have have_x associations. So what I am wondering is this is possible, will it work? Also is there a better way to do this, maybe something I’m missing? Any insight would be much appreciated!

  • 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-27T06:49:36+00:00Added an answer on May 27, 2026 at 6:49 am

    I don’t believe that will work. You may want to use the belongs_to method to associate your Appointment to your Client:

    class Appointment < ActiveRecord::Base
      belongs_to :client
    end
    
    class Client < ActiveRecord::Base
      has_many :appointments
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have a Rails 3.1 app that hosts multiple sites for several different
I am currently making a rails app that will search #barcampmlk2 #{thesessionname} +1 from
I have a site build on rails that provides XML version of all relevant
I have some javascript making an ajax call in my Rails site: $.ajax({type: PUT,
I have a Ruby on Rails model that has quite a few HABTM relationships.
I'm new to Rails and making application where college members (teachers and students) can
I'm making a simple search form in rails. In my search view I have
I'm making a custom generator that generates a new rails app, and I do
I have been using the Rails console a fair bit lately and its making
Making good progress on rails now, but hit a snag on heroku deployment. After

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.