# Linking Models

**URL:** <https://www.ruby-forum.com/t/linking-models/194019>\
**Category:** Rails\
**Created:** [August 28, 2010, 4:24am UTC](https://www.ruby-forum.com/t/linking-models/194019 "2010-08-28T04:24:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![crashbangboom](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/9e8a1a/32.png) [@crashbangboom](https://www.ruby-forum.com/u/crashbangboom)\
**Post date:** [August 28, 2010, 4:24am UTC](https://www.ruby-forum.com/t/linking-models/194019/1 "2010-08-28T04:24:37Z")

</div>

Hi…

I’m just starting with Rails 3.0.0.rc and am trying to get my models  
to link as I did in previous rails releases…

I.e…

I used to be able to tell the model:  
belongs\_to :districts

then in the controller:  
def index  
@districts = District.find(:all)  
@provers = Prover.find(:all)  
…  
end

then in the view have a line like:  
\<% @provers.each do |prover| %\>  
\<%= prover.district.name %\>  
…

I’m expecting this to join the provers and districts tables so I can  
return the district name instead of it’s foreign key id…!

At any rate, in rails 3 this no longer works…

---

<div class="post-metadata">

**Author:** ![crashbangboom](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/9e8a1a/32.png) [@crashbangboom](https://www.ruby-forum.com/u/crashbangboom)\
**Post date:** [August 30, 2010, 6:32pm UTC](https://www.ruby-forum.com/t/linking-models/194019/2 "2010-08-30T18:32:12Z")

</div>

crashbangboom wrote:

> Hi…
> 
> I’m just starting with Rails 3.0.0.rc and am trying to get my models  
> to link as I did in previous rails releases…

[…]

> At any rate, in rails 3 this no longer works…

When asking for help, never just say “it doesn’t work”. Always explain  
how the actual behavior differs from the expected behavior. Include  
error messages if any. Otherwise, it’s unlikely that anyone will be  
able to help you.

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid
