On Mar 16, 5:41 pm, Rohit Shinde <[email protected]> wrote: > Hello All, > > I am very new to Ruby on Rails and I have a quick question for you all, > which is as follows: > > I have this following line of code in an partial that renders itself on > the posts/index view: > Created By (User): <%= User.find(:all, :select => 'name', :conditions => > ["id = ?", 1]) %> > (I am hard-coding that '1' there) > > Now, when I run the server; the above line of code displays just the '#' > symbol.. nothing else (no name is displayed :-( ): > Created By (User): # >
That's because all that is being stuck in the view is something like #<User id: 1, name: "Ron", created_at: "2010-03-15 02:45:28", updated_at: "2010-03-15 02:45:28"> Which isn't legal html (you can verify this by viewing the html source in your browser) Fred -- 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

