Re: Table connection issue

Colin Law
2010-09-23T15:40:37Z

On 23 September 2010 16:35, PalaniKannan K
<kpalanikannan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:

Please don''t top post it makes it difficult to follow the thread,
thanks.

> Hi,
>
> I tried with
>
> In View
>
> <% @names.each do |name| %>
> <%= name.age %>
> <% name.cities.each do |city| %>
> <%= city.local_area %>
> <% name.countries.each do |country| %>
> <%= country.state %>
> <% end %>
>
> This shows no error with no output of city.local_area and country.state.

Are you sure it is finding any cities and countries?  Try displaying
name.cities.count and the same for countries.  Even better have a look
at the Rails Guide on debugging and use ruby-debug to break in and
examine the variables.

Colin