[Instantrails-users] New User having some difficulties

Johnny Meek johnnymeek at yahoo.com
Mon Dec 8 02:10:59 EST 2008


This is my first experience with InstantRails and RoR. I am running InstantRails on a Vista platform for educational / development use only. I am using a mySQL database. Note that I created the database and tables and populated the tables from a mysql command prompt - if that is relevant.

In my database, I have a table named equipments. When I try to execute a query against it in a controller method - as basic as @var = Equipment.find(1) - I get an error message as follows: ActiveRecord::StatementInvalid - Table 'cars_development.equipment' doesn't exist.

It appears that Rails is looking for a table named equipment rather than equipments. ?? The model for this table is very simple:

class Equipment < ActiveRecord::Base
    has_many :corvettes_equipments
end

Attempts I have made to correct the problem are: delete and re-create the models, drop and re-create the table, drop and re-create the database, created a new RoR project and copied the views, models and controller from the old project. None of this has worked for me.

I finally tried creating a new table using a different name and this worked. As far as I know, I followed the same steps for this new table and model as I followed for the old one.

This project is for a class, and I really need to use the table name that matches the assignment specs. The project will be graded using a database that my instructor builds and I can't exactly ask him to make a new table just to comply with my project's design.

Thank you in advance for your response,
Johnny Meek



      


More information about the Instantrails-users mailing list