# Mangled database record ids

**URL:** <https://www.ruby-forum.com/t/mangled-database-record-ids/51363>\
**Category:** Rails\
**Created:** [December 30, 2005, 5:51am UTC](https://www.ruby-forum.com/t/mangled-database-record-ids/51363 "2005-12-30T05:51:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mary\_Cook](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/cdc98d/32.png) [@Mary\_Cook](https://www.ruby-forum.com/u/Mary_Cook)\
**Post date:** [December 30, 2005, 5:51am UTC](https://www.ruby-forum.com/t/mangled-database-record-ids/51363/1 "2005-12-30T05:51:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Mary\_Cook](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/cdc98d/32.png) [@Mary\_Cook](https://www.ruby-forum.com/u/Mary_Cook)\
**Post date:** [December 30, 2005, 6:24am UTC](https://www.ruby-forum.com/t/mangled-database-record-ids/51363/2 "2005-12-30T06:24:13Z")

</div>

> 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

---

<div class="post-metadata">

**Author:** ![Mary\_Cook](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/cdc98d/32.png) [@Mary\_Cook](https://www.ruby-forum.com/u/Mary_Cook)\
**Post date:** [January 1, 2006, 5:00pm UTC](https://www.ruby-forum.com/t/mangled-database-record-ids/51363/3 "2006-01-01T17:00:52Z")

</div>

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
