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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T08:55:22+00:00 2026-06-03T08:55:22+00:00

I may be confusing the two entirely, but I’m seeing that forms can facilitate

  • 0

I may be confusing the two entirely, but I’m seeing that forms can facilitate associations using an array argument based on nested routes, ex:

<%= form_for [@project, @task]...

or using the fields_for helper if the parent class accepts_nested_nested_attributes_for the child.

What’s the difference / trade-offs between these approaches?

  • 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-03T08:55:24+00:00Added an answer on June 3, 2026 at 8:55 am

    I didn’t find the answers given to be as clear as I had hoped, so after doing a bit more research I discovered an answer that satisfied me and so I figured I’d share it with others.

    Nested routes approach

    Basically, the nested routes approach is useful when you’re presenting a form for a child model as a single form in it’s own right. In other words, if you have a blog with a Post model with a Comment model as it’s child, you can use nested routes to present the form for the child such that submitting that form will let rails do its magic in terms of associating the child with the parent.

    Nested attributes approach

    The accepts_nested_attributes_for method on the other hand, is more aptly used to present a form that while taking on the appearance of a single form, is really multiple forms merged together with a single submit button.

    So to summarize, the nested routes approach deals with one model in single form (albeit associated with a parent model), while the nested attribute approach deals with multiple models in a single form.

    The difference might be subtle to newcomers, but meaningful enough to understand.

    Hope this helps others who had questions about this. Cheers.

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

Sidebar

Related Questions

Title may be confusing, but here's explanation with code. Based on some conditions, I
The title may sound confusing but it actually isn't, I just didn't know how
I understand the title may sound confusing, but the goal is very clear: I
The title may be bit confusing but here is what I am facing I
The title may have been confusing, but please let me explain: Currently when I
The title may be a little confusing, but I don't know how else to
I have an SQL question which may be basic to some but is confusing
I may confusing with the terminology, but here is what I'm trying to do:
I pulled data from RETS server (Using one MLS) but now I am confusing
Ok so the title may have been confusing so i have posted 2 code

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.