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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:14:33+00:00 2026-05-13T18:14:33+00:00

I edited this message do to sloppiness and changes. def student_test @student = Student.for_test.find(params[:id])

  • 0

I edited this message do to sloppiness and changes.

def student_test
@student = Student.for_test.find(params[:id]) if params[:id]
@student ||= Student.new
run_sequence :testize
end

def test_finalize
Student.transaction do
if (params[:student]) and @student.update_attributes(params[:student])
  @student.test!
end

room = Room.new(:room_num => 5)
room.save

book = @student.books
book.id_num = room.id
book.save
end
end

This returns this error message:
undefined method `id_num=’

Is this because there is more than 1 book record being passed into book?

Any suggestions? Thanks.

  • 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-13T18:14:33+00:00Added an answer on May 13, 2026 at 6:14 pm

    Assuming Student has a has_many relationship to Book, then @student.books is returning an array of book records, so you’ll need the following:

    books = @student.books
    books.each do |book|
      book.id_num = room.id
      book.save
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

edited, this is it function handleDate( timestamp ) { var n=new Date(), t, ago
I edited this question after i found a solution... i need to understand why
I've edited this quite a bit and bolded my question at this point. I
I'm using Wamp 2.2, edited conf/extra/httpd-vhosts.conf edited this file to add VirtualHosts , but
Edited Question: This should be clear. using System; namespace UpdateDateTimeFields { class Program {
Warning: This question has been heavily edited. I tried my best to guess the
NB: This question has been extensively edited to make it more relevant, for completeness
I have this code that I've edited: http://pastebin.com/vrqHek6S I've put in comments where I
I have this code inside a header (edited): template <int i> class A {};
Edited: SOLUTION FOUND. This is strange and not the best solution, but I just

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.