sunspot solr, rails 3.1.1: Why do my results have the entire db record printed automatically?

I did the standard procedure in setting up Sunspot Solr for my rails app but when I print the results, I get the entire db record printed automatically.

Here is my results.html.erb:

<%= @users.each do |result| %>
    <%= link_to "#{result.first_name}", user_path(result) %>
<% end %>

The view rendered is:

Test [#<User id: 38, first_name: "Test", last_name: "Test", email: "test@test.com", encrypted_password: "b519f1c58f8f5b9fffa0ada91ac7ca8316ebb8f8cec548404b8...", salt: "7f6287c48f49ac0a55c2cdc00803caaaa463c3b5efb88b57f40...", created_at: "2011-11-28 07:00:32", updated_at: "2011-11-28 07:00:32">

Can you please tell me how can I get rid of the hash and just be able to display the first name?

Thanks in advance

Answers


take out the = at <%= @users.each do |result| %>

so instead

<% @users.each do |result| %>
    <%= link_to "#{result.first_name}", user_path(result) %>
<% end %>

Need Your Help

NullpointerException from spinner.java:828 dismiss

android nullpointerexception spinner

I'm new to java/android and trying to help out with an open source project. I decided I could learn the most from trying to fix bugs and so I've been running Monkey on the app to start generating c...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.