Can not fetch data from other table

as per ur db design u can do up to

URL : <%= @site_detail.url%>

TITLE: <%= @site_detail.title%>

Email: <%= @site_detail.email%>

Posting ID: <%= @site_detail.postingid%>

Date: <%= @site_detail.date%>

Price: $<%= @site_detail.price%>

City: $<%= @site_detail.location%>

<% countries = Location.find(:all,:select => ['country'], :conditions => ['city =?',@site_detail.location]) <% for country in countries %> Country Name :<%= country %> <%end %> <% states = Location.find(:all,:select => ['state'], :conditions => ['city =?',@site_detail.location]) %> <%for state in states %> State :<%= state %> <%end %>

:slight_smile: as ur city name is for many states and countries.

if u want the other way consult ur db designer who designed the DB :x

:slight_smile:
Bala

On Tue, Sep 2, 2008 at 5:12 PM, bala kishore pulicherla
<[email protected]

Bala kishore Pulicherla wrote:

Do u want to display all the states and countries for that city…???

or u want to display the country and state of the particular site??

On Tue, Sep 2, 2008 at 5:10 PM, Dharmdip R. <

display the country and state of the particular city??

whats the column name in site_details table???

On Tue, Sep 2, 2008 at 5:32 PM, Dharmdip R. <

undefined local variable or method `locations’ for
#<#Class:0x46c0bc0:0x46c09e0>

Bala kishore Pulicherla wrote:

whats the column name in site_details table???

On Tue, Sep 2, 2008 at 5:32 PM, Dharmdip R. <

location !

whats ur find conditions for @site_detail??

On Tue, Sep 2, 2008 at 5:34 PM, bala kishore pulicherla
<[email protected]

Dharmdip R. wrote:

Bala kishore Pulicherla wrote:

whats the column name in site_details table???

On Tue, Sep 2, 2008 at 5:32 PM, Dharmdip R. <

location !

i have added ur id [email protected] in my contact list !
[email protected]