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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T04:49:07+00:00 2026-06-11T04:49:07+00:00

Rails often teaches me that other people have thought about my problems before I

  • 0

Rails often teaches me that other people have thought about my problems before I have but this time, I did not find anything…

I have 3 models : Node, Volume and Filesystem (I’m using Mongoid but I think the problem is the same with ActiveRecord)

Node has_many volumes and filesystems ; Volume has_many filesystems.

I define volumes and filesystems in the same ‘node’ form (with JS updating each filesystem’s “volume” selectbox when a volume is added/changed/removed). This form works fine.

The problem resides when trying to persist filesystems when saving node :

As new volumes doesn’t have any ID yet, I’m using volumes name as values in the selectbox, but the foreign key is the ID (names are unique within a node but different nodes will have volumes with same name, so I can’t use name as an ID).

In nodes_controller‘s create and update actions, I need to find a solution to save volumes first, and then replace params[:node][:filesystems_attributes] containing volume names by their respective IDs. This is very dirty and I’m wondering if it could be done in a clean way.

Has anyone else had the same issue?

The only really “clean” solution would be to save volumes and filesystems in different steps but my app really needs to be “less clicks is better” as Node contains many other nested models (and forms).

  • 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-11T04:49:09+00:00Added an answer on June 11, 2026 at 4:49 am

    I’ve just nested Filesystem into Volume instead of Node and it works like a charm.

    Bad designs make bad questions ;o)

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

Sidebar

Related Questions

Very often in a rails project, I have a 'content' controller that houses miscellaneous
I've been developing Ruby on Rails applications for some time, and have often found
I'm using Rails 3.2.3 with Ruby 1.9.3p0. I'm finding that I often have to
I often see things like this in rails views: <% form_tag some_path do -%>
I running a rails project and I am displaying a textfield that can often
Rails make It possible to map resources that are logically children of other resources
Rails has a nice idiom that makes it easy for you to have a
I have a rails application that occasionally needs to do very slow network calls
I have a Rails application that has to co-exist with a very old legacy
I have recently started learning about Software as a Service and Cloud computing. Often

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.