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? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thank you SOOO much, i have tried to find out how to do it for a long time now. and u gave me a fast and exact answer to my problem, THANKS!! Thank you Thank you! -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---