Hi, I have model with custom primary key:
document.rb
class Document < ActiveRecord::Base
set_primary_key "token"
end
routes.rb:
MyApp::Application.routes.draw do
resources :documents, :only => [:index, :show, :create]
end
When i create new document, i get error:
No route matches {:controller=>"documents", :id=>#<Document id: "b430cfe73aaa5235fbfe", token: "b430cfe73aaa...
When i switch to use :id as a primary key, everything is OK. But I need to use token.
I use: rails 3.0.0 and ruby 1.8.7 (2010-04-19 patchlevel 253) [i686-linux], MBARI 0x8770, Ruby Enterprise Edition 2010.02
Thanks for help.