Forum: Ruby on Rails Retrive record without id field

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.
65d5822c31ba70aa39b72352a61d90bf?d=identicon&s=25 Sushrut Sathe (sushrut)
on 2009-04-03 16:09
Hi,
How to retrive the record without using the id field.
I have to use the table having singular and in that table there is no id
field then how to fetch that table in my application.
81b61875e41eaa58887543635d556fca?d=identicon&s=25 Frederick Cheung (Guest)
on 2009-04-03 16:27
(Received via mailing list)
On 3 Apr 2009, at 15:09, Sushrut Sathe wrote:

>
> Hi,
> How to retrive the record without using the id field.
> I have to use the table having singular and in that table there is
> no id
> field then how to fetch that table in my application.

You could use find :first or find :all, just specify whatever
conditions are relevant.

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