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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T18:35:22+00:00 2026-05-11T18:35:22+00:00

http://weblog.rubyonrails.org/2009/1/26/nested-model-forms This post helped in learning how to handle multiple models in a rails

  • 0

http://weblog.rubyonrails.org/2009/1/26/nested-model-forms

This post helped in learning how to handle multiple models in a rails form. It works as long as the models are nested. what if they are not? lets say, I have a form, where the user fills personal details, address details and a bunch of checkboxes specifying her interests. There are at least 3 tables involved in this one single form, what is the best way to handle this, without having 3 different save buttons?

  • 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-11T18:35:22+00:00Added an answer on May 11, 2026 at 6:35 pm

    Two options:

    First is ActivePresenter which works well for this.

    Second is just to use fields_for:

    <%= form_for @user do |f| %>
    
       <%=f.label :name %>
       <%=f.text_field :name %>
    
       <%= fields_for @address do |fa| %>
          <%=fa.label :city %>
          <%=fa.text_field :city %>
       <% end %>
    
    <% end %>
    

    Then in the controller, save the records.

     @user = User.new(params[:user]) 
     @address = Address.new(params[:address])
    

    ActivePresenter works so well though.

    Also found a railsforum post via Google, which would work well.

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

Sidebar

Related Questions

I don't get it! Rack: http://rack.rubyforge.org/ Rails Metal: http://weblog.rubyonrails.org/2008/12/17/introducing-rails-metal I read the two articles
I saw this example about storing login information in cookie. http://eisabainyo.net/weblog/2009/02/20/store-login-information-in-cookie-using-jquery/ Tried it, but
Began restructuring my Backbone app referencing this article by Bocoup: http://weblog.bocoup.com/organizing-your-backbone-js-application-with-modules I'm having trouble
I'm aggregating RSS feeds using FeedTools. I followed this tutorial: http://simonwoodside.com/weblog/2008/12/7/ruby_on_rails_feedrss_aggregator/ and everything functioned
Can anyone explain what happens to CSS in high contrast mode? http://hardlikesoftware.com/weblog/2009/11/04/css-sprites-vs-high-contrast-mode/ In high
I'm using this http://www.i-marco.nl/weblog/jquery-accordion-menu/ accordion menu. Problem is, is that the main-menu links only
I'm learning ruby on rails by following the tutorials in http://ruby.railstutorial.org/ . I'm getting
I am following this tutorial http://www.magentocommerce.com/knowledge-base/entry/magento-for-dev-part-5-magento-models-and-orm-basics . As per this tutorial,when i pass a
I'm using code examples from this article by Rick Strahl: http://www.west-wind.com/weblog/posts/324917.aspx to make async
I'm going to get data with Restlet of this official OData page: http://services.odata.org/OData/OData.svc/ I've

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.