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

  • Home
  • SEARCH
  • 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 3481554
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T10:27:39+00:00 2026-05-18T10:27:39+00:00

This is so simple that it’s ridiculous I couldn’t find any information about this

  • 0

This is so simple that it’s ridiculous I couldn’t find any information about this anywhere including API docs and Rails source code:

I have a :belongs_to association and I’ve come to understand the normal model methods you call in the controller when you DON’T have an association are slightly different than the ones when you DO.

For example, I’ve got my association working fine for the create controller action:

@user = current_user
@building = Building.new(params[:building])

respond_to do |format|
   if @user.buildings.create(params[:building])
# et cetera

but I can’t find docs on how update works:

@user = current_user
@building = @user.buildings.find(params[:id])

respond_to do |format|
  if @user.buildings.update(params[:building])
# et cetera

Using the update method gives the error “wrong number of arguments (1 for 2)” and I can’t figure out what arguments are supposed to be sent.

  • 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-18T10:27:40+00:00Added an answer on May 18, 2026 at 10:27 am

    Use update_attributes:

    @user = current_user
    @building = @user.buildings.find(params[:id])
    
    respond_to do |format|
      if @building.update_attributes(params[:building])
         #...
      end
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a super simple question that I just can't seem to find a
Sorry for this simple question but I seem not to find any other way
This sound so simple that I can't figure out why I can't find the
I am sure this is very simple but I can't find an answer anywhere.
I have this simple code that speaks for itself. <script language='javascript"> function check() {}
I have this very simple example that I am using to learn structs in
This is a simple code that open and print the file content. #include <stdio.h>
I know this is going to be something simple that I'm just missing somehow,
I am trying to understand this simple hashlib code in Python that has been
I made this simple function to filter the data. I add the symbols that

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.