I was searching google and stackoverflow for long time, but I can’t find the solution of my problem.
Lately, I was using set_primary_key for a table called “employee”, because I need to use ther personnel number as my primary key. If I set the code
`set_primary_key :personel_number`
(Personel_number is already a collumn which I want to use as primary key) into my model before I do rake db:migrate and do migrating at last, I come into troubles when I try to fill my database via browser:
`Couldn't find employee with ID=1`
`app/controllers/mitarbeiters_controller.rb:16:in `show'`
Rails searches for employee with ID=1 but it can’t find, because I set primary key from personel_number with 601 (e.g.).
Can I do something against it or shall I let Rails create it’s own :id first?
It sounds like when the page goes to the controller to create the employee you have a redirect to show the new employee and it is using the default id.