# One-to-One Associations and REST

**URL:** <https://discuss.rubyonrails.org/t/one-to-one-associations-and-rest/9634>\
**Category:** rubyonrails-talk\
**Created:** [March 3, 2007, 1:34pm UTC](https://discuss.rubyonrails.org/t/one-to-one-associations-and-rest/9634 "2007-03-03T13:34:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrew5](https://avatars.discourse-cdn.com/v4/letter/a/eb8c5e/32.png) [@Andrew5](https://discuss.rubyonrails.org/u/Andrew5)\
**Post date:** [March 3, 2007, 1:34pm UTC](https://discuss.rubyonrails.org/t/one-to-one-associations-and-rest/9634/1 "2007-03-03T13:34:46Z")

</div>

Hi, I’m still finding my way around RoR myself but isn’t what you want something like?:

class User \< ActiveRecord::Base has\_one :Avatar, :foreign\_key =\> “your\_avatar\_id\_key”, end

class Avatar \< ActiveRecord::Base belongs\_to :User, :foreign\_key =\> “you\_user\_id\_key”, end
