As the title says, one of my helper functions to render partials isn't rendering correctly.
def render_contact_list
@contact_groups = ContactGroup.find(:all, :conditions => ["user_id = ?", current_user.id])
@contact_groups.each do |contact_group|
@contacts = Contact.find(:all, :conditions => ["group_id = ? and Owner_id = ?", contact_group.id, current_user.id])
render :text => "#{contact_group.name}<br />"
render(:partial => 'contacts/partials/view_contacts', :collection => @contacts, :as => :contact)
end
end
All that displays on the page is
##
When looking at the HTML of the rendered page, it looks like this:
#<ContactGroup:0x103090c78>#<ContactGroup:0x103090b60>
I commented out the block function completely and it still displayed the above.
Could someone please give some insight on what I'm doing wrong?
Edit: I just realized that the ## is coming from @contact_groups being the last value assigned on the page. It's returning the value and not rendering any of the code within the block.