I have 2 tables: Products and ProductLines
Products:
id
product_line_id
ProductLines:
id
product_line
Product Model:
ProductLine Model:Code:class Product < ActiveRecord::Base belongs_to :product_line end
In my listing code, I am trying to show the product line for each product like this:Code:class ProductLine < ActiveRecord::Base has_one :product end
I am getting this error:Code:<% for product in @products %> <tr><td><%=h product.product_line %></td></tr> <% end %>
DBI: DatabaseError: Execute
OLE error code:80040E37 in Microsoft OLE DB Provider for SQL Server
Invalid object name 'product_lines'.
HRESULT error code:0x80020009
Exception occurred.: SELECT TOP 1 * FROM product_lines WHERE (product_lines.id = 4)
Note that it thinks my table is named 'product_lines' when it is really named ProductLines. Also note that I am using MS SQL Server, which should be fine, but is noteworthy.







Bookmarks