setting primary key for a database not named “:id”
I am using: rails 2.3.5 ruby 1.8.7 and Windows 7 Home Basic I was given a database and I connected it to rails, having no problems reading and getting data from it. Now what I want to do is add some functionality in it (add, edit and delete) but when I try to set my primary key to the table's primary key (ProductCode) by doing this code: class Product < ActiveRecord::Base self.primary_key :ProductCode end I got this error when doing a @products = Product.find(:all, :limit => 10) : ArgumentError in PosController#index wrong number of arguments (1 for 0) How can I solve this ? Here's my