Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > different id_field

Reply
Thread Tools

different id_field

 
 
Sushrut Sathe
Guest
Posts: n/a
 
      04-03-2009
Hi,
In my table there is no id field,i.e. I have the field with the name
id_host
then how to use that field in my application without changing the field
name.
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
Stephen Celis
Guest
Posts: n/a
 
      04-03-2009
Hi,

On Apr 3, 2009, at 10:12 AM, Sushrut Sathe wrote:

> Hi,
> In my table there is no id field,i.e. I have the field with the name
> id_host
> then how to use that field in my application without changing the
> field
> name.



Assuming you mean Rails, you may have better luck next time asking on
their list. Try this:

class ModelName < ActiveRecord::Base
set_primary_key "id_host"
end


- Stephen

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Different languages in different controls chanmmn ASP .Net 2 09-07-2004 07:24 PM
Different responses from different systems Tigerhillside Perl 3 02-23-2004 01:56 AM
Re: How do I show different user control on different querystring ? Kevin Spencer ASP .Net 0 08-25-2003 12:49 PM
Re: How do I show different user control on different querystring ? Dotnetjunky ASP .Net 0 08-25-2003 12:22 PM
Bind different rows to different data sources in data grid AD ASP .Net 1 08-23-2003 10:34 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57