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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T16:58:39+00:00 2026-05-30T16:58:39+00:00

What would be the best way to split a user profile model and its

  • 0

What would be the best way to split a user profile model and its form into several sub forms that you can update separately?

like
* basic details

  • details details
  • my photos
  • my interests

You can only have 1 edit action, so what would be the preferred way of handling this?

  • 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-30T16:58:40+00:00Added an answer on May 30, 2026 at 4:58 pm

    So in reality, what you really probably want to do is create a set of nested resources for the user, so that you can treat each of these separately.

    resources :users do
      resource :basic_details
      resource :detailed_details
      resources: :photos
      resources: interests
    end
    

    Which gives you routes like: edit_user_basic_details(@user), so then, you can have forms that hit the update actions of these sub resources, like this:

    <%= form_for :basic_details, url: user_basic_details_path(@user) do |form| %>
      <%= form.text_field :name %>
      <%= form.submit %>
    <%= end %>
    

    This way, you can setup controllers like this:

    class BasicDetailsController < ApplicationController
      def edit
       @user = User.find(params[:user_id])
      end
    
      def update
       @user = User.find(params[:user_id])
       @user.update_attribures(params[:basic_details])
      end
    end
    

    This is a very quick and dirty way to implement this, but its meant to show you have to get started. You don’t have to think about form and controllers as only editing tables in your database, sometimes its much more convenient to think about particular parts of one of your models as its own resource which can be edit separately.

    Hope this gets you started.

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

Sidebar

Related Questions

What would be the best way to fill an array from user input? Would
what would be the best way to split this in python. (address, city, state,
In JS if you would like to split user entry into an array what
What would be the best way to resize a user recorded video on the
I'm trying to find the best way to split data into groups, for example
What would be the best way to split a string on the first occurrence
What would be the best way to get all divs that have any class
In Java, what would the best way be to have a constantly listening port
I want to make a code snippet database web application. Would the best way
What would be the best way to have a list of items with a

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.