John Aston wrote:
hi im new to ruby on rails, and I have a stupid little problem, when i do <%= Class1.find(:first) %> in a view file, it just shows "#" on the website
how do make it the value in the mySQL table?
It is finding the first one, and spitting out a representation of it, like
#<Class1:0x42924a68 @attributes={...
the < is confusing the HTML parser - but you don't want that anyway. You want to display something about that first record, like:
<%= Class1.find(:first).name %>
or perhaps
<% first = Class1.find(:first) %>
<%= first.name %> <%= first.attribute1 %> <%= first.attribute2 %>
etc.