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 -%>
<%= h(contact.id) %>
<%= h(contact.naam) %>
<%= h(contact.adres) %>
P <%= h(contact.postcode) %> P <%=
h(contact.plaats)%>
T <%= h(contact.telefoon) %>
E <%= h(contact.email) %>
<%= link_to 'Detail', :controller =>
'pages', :action => 'show', :id => acontact %>