Hi,
I want to list all the records in my contacts table (platform
WindowsXP, InstantRails latest version with MySQL,
Rails 2.0.2 ).
I populated the table contacts with test data, however the problem is
that in the view some columns
show their data, and some columns are just ''empty'' i.e I don't see
their value but these values do exist in the table ??
Hope someone can help here.
In my controller I do
class PagesController < ApplicationController
def index
@contacts = Contact.find(:all)
end
def show
@contact = Contact.find(params[:id])
end
end
in my view index.rhtml I have
<% for contact in @contacts -%>
<div id="table_row">
<div id="contact_id"><%= h(contact.id) %></div>
<div id="contact_naam"> <%= h(contact.naam) %></div>
<div id="contact_adres"><%= h(contact.adres) %></div>
<div id="contact_plaats">P <%= h(contact.postcode) %> P <%=
h(contact.plaats)%></div>
<div id="contact_telefoon">T <%= h(contact.telefoon) %></div>
<div id="contact_email">E <%= h(contact.email) %></div>
<div id="record_links"><%= link_to 'Detail', :controller =>
'pages', :action => 'show', :id => acontact %></div>
</div>
<% end %>