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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T23:24:51+00:00 2026-05-23T23:24:51+00:00

Im creating a many to many association rails project, and im getting the following

  • 0

Im creating a many to many association rails project, and im getting the following errors when i run new.html.erb:

Table 'purchase_form_rails.account_numbers_pi_names' doesn't exist

undefined local variable or method `account_numbers' for #<#<Class:0x2a979ef4>:0x2a978770>

Extracted source (around line #34): 

(It should be looking in the database purchase_form_rails, and the table account_numbers (the in between table joining pi_names and account_numbers is pi_names_account_numbers)

Heres my new.html.erb:

  <div class="field">

        <% for account_number in @account_numbers %>
           <input type="checkbox"
                id="<%=account_number.id%>"
                name="account_numbers_ids[]"
                value="<%=account_number.id %>"
                <%if @pi_name.account_numbers.include? tag%>checked="checked"<%end%>
         > <%=account_numbers.account_number%>
        <% end %>

  </div>

Let me know if you need any more info!

  • 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-23T23:24:52+00:00Added an answer on May 23, 2026 at 11:24 pm

    If you are defining a has_many:thorough then rails expects join table name should be alphabetically sorted like account_numbers_pi_names( This should be the join table name not pi_names_account_numbers) .

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

Sidebar

Related Questions

Following on from my earlier question about creating Address Books (many thanks Peter!), I
In many code samples, people usually use '\0' after creating a new char array
We are creating many XML files for a single app in developing android applications;
how would i go about creating a many-many relationship among data objects in google
I'm creating a Facebook application that uses many calls to Facebook's asynchrunner class. As
There are too many options for creating projects in XCode, But When we select
I am creating an application which involves so many web-service calls. I am using
I am creating a web application that will have many users. Each user has
I've creating a Java Swing application and I realized that I have many many
I am creating a simple Android widget with a typical usecase of having many

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.