I upload documents and then on my admin home page I display all the documents like so:
<% @document.each do |document|%>
<p><%= link_to document.name, document.contract_url.to_s%></p>
<%end%>
In my user's home page I render the documents that belong to specific users like so:
<%= current_user.documents.each do |document|%>
<p><%= link_to document.name, document.contract_url.to_s%></p>
<%end%>
But in the user's home page I get this array after my link.
Document Name (link)
[#<Document id: 2, name: "Document Name", user_id: 2, contract: "contract_name.pdf", created_at: "2012-10-03 13:12:40", updated_at: "2012-10-03 13:35:35">]
I do not get this array in my admin panel. I just get the "Document Name" link. Does anyone know what could be causing this?