Forum: Ruby on Rails mangled database record ids

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Mary Cook (Guest)
on 2005-12-30 06:51
(Received via mailing list)
I've been going through the excellent tutorial in Agile Web
Development With Rails, and hit a bit of a snag.  After doing the
'pretty listings' functionality for the Admin controller, attempting
to click 'Show' next to a product produces an error: 'Couldn't find
Product with ID=#<Product:0x276180c>'

Further, the URL of the page that produces the error looks really
weird: '[...]/admin/show/%23%3CProduct%3A0x276180c%3E' Navigating to
'[...]/admin/show/1' works fine.

It seems that either Rails or Ruby (or I) are mangling the database
record id values, but I'm not sure why, or how to fix the problem.

Any help greatly appreciated.

Thanks!

Mary
Benjamin S. (Guest)
on 2005-12-30 07:24
(Received via mailing list)
> I've been going through the excellent tutorial in Agile Web
> Development With Rails, and hit a bit of a snag.  After doing the
> 'pretty listings' functionality for the Admin controller, attempting
> to click 'Show' next to a product produces an error: 'Couldn't find
> Product with ID=#<Product:0x276180c>'

It sounds like you're using an older version of Rails that doesn't
automatically pick the id out of models assigned to the :id field in
a route. What does `gem search rails` report?

-Ben
Mary Cook (Guest)
on 2006-01-01 18:00
(Received via mailing list)
Thanks for your help! After rather a lot of fiddling, I managed to
install the latest version of rails, and now the problem is solved.

Thanks again,

Mary
This topic is locked and can not be replied to.