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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T20:58:00+00:00 2026-06-18T20:58:00+00:00

I have a regular form for User information which starts like so: <%= form_for(@user,

  • 0

I have a regular form for User information which starts like so:

<%= form_for(@user, :html => { :class => "form-horizontal" }) do |f| %>
    <%= f.text_field :last_name %>
    ...
    <%= f.submit "Submit", class: "btn btn-primary", :name => "submit_button" if @user.last_step? %>
<% end %>

I also have some non User fields in the form. Here’s an example:

<%= f.label "When is your birthday?" %>
<%= select_tag "month" %>
<%= select_tag "day" %>
<%= select_tag "year" %>

How would I save this to a different table than User?

  • 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-18T20:58:01+00:00Added an answer on June 18, 2026 at 8:58 pm

    If you want to update a model other than User, you should probably use accepts_nested_attributes_for and fields_for. The alternative is to just do the work in your create action of your UsersController, ie:

    def create
      @user = User.create params[:user]
      @foo = Foo.find params[:foo_id]
      @foo.date = Date.new(params[:foo_year], params[:foo_month], params[:foo_day])
      ...
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is quite the pickle... I have a regular HTML form with a couple
I have regular form like this. <form action=/domainchecker.php method=post> <input type=text name=domain size=20> <fieldset>
I have a form which the user has to fill in. A couple of
I have a New user form both for admins and for regular users. Both
I have a complex form It allows the user to create an IncomeDeclaration which
I have a regular expression which allows the value range '1111' - '999999', excluding
I have a regular expression which uses GroupCollection s in it's capture to capture
I have a form that looks something like this: <form id=uploadForm name=uploadForm method=post enctype=multipart/form-data>
i have a regular html Grid and i am binding my asp.net mvc view
I have 5 functions that check user input against regular expressions...these regular expressions have

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.