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

The Archive Base Latest Questions

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

I have a project going on right now that is really big data model

  • 0

I have a project going on right now that is really big data model wise. I am trying to figure out the best way to handle inter-model relationships.

For the sake of brevity:

Car
  has_many :passengers
  has_many :items

or

Team
  has_one :head_coach
  has_many :coaches
  has_many :players
  belongs_to :owner

So from the show page I would see who is in the car and what items are in the car. I have some co-workers who think we should have a controller action called manage where they would click a link on the show page to manage the relationship between the other models

So the Team controller would have this

class TeamController < ApplicationController
  # ... magic ...
  def manage_players
     @signed_players = Player.signed_players
     @free_agents    = Player.free_agents
  end
end

The manage_players view would just have links to the actual RESTful actions on the appropriate controller to remove relationships etc…

Anyone have thoughts on how this should be accomplished?

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

    That’s an overly complicated approach, and the good news is, it’s way simpler than you think.

    Save yourself some trouble. The quick answer to your question is to use nested resources: you can have a single form that handles the Car and all the associated passengers/items, or the Team and its coach, players, etc.

    The action/view you’re describing would just be the edit action on the Car/Team. The manage action name is a nice idea and all, but the action you’re really taking is an edit (nothing special, by what you’re describing), so why confuse what’s going on when the default is to call it edit?

    If you want a live example of something that takes advantage of nested routes, check out rpglogger.com (it’s my site). When you play around with it, notice the routes/URLs in the address bar.

    It’s also open source. Specifically relevant to your question is:

    • see the routes.rb file, and note how I define resources on sections twice – this actually gives me two different versions of the routes – one that’s scoped to the LogBook, and one that’s scoped to the objects in a section
    • see the world_object_form.haml (haml also rocks, FYI), which is both my new and edit form – yet it’s short, rather uncomplicated, and pretty easy to read/undestand given what it does.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a model that has one column right now, description , that populates
I have project that I'm working on that is going to require a webserver.
I have a project that I thought was going to be relatively easy, but
Some complex subversion merges are coming up in my project: big branches that have
I am kicking off my final year project right now. I am going to
I'm a software developer, and I'm going onto a project now that involves implementing
I have a basic GWT Maven project going. I added SmartGWT and started playing
So I have a project where there is some automatic initialization going on through
I have a school project in which we're going to write a financial engine
I'm going to have to write a number of vba modules for a project

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.