I have an app, which implements a group feature. Each group has n members. Also, each group has a group specific profile pic to it.
I have been able to implement auto c
So, in parts:
Sorry any engrish.
Update:
The collect(&:title) says "from all investor_groups that you find, give me only their titles". So, remove it completely, using only:
InvestorGroup.find(:all, find_options)
It says "give me the investor_groups that you find", so you will have an array of investor_groups to use in the partial. With this, you can show the data that you want in the autocomplete list, like you did in the index.html, with a "for" statement, putting inside the "li" elements the images, the title and the activated members size.
Sorry any engrish.
Re-Update
Almost there. To the autocomplete works, the response from the autocomplete method must be a list. So, the partial would be like:
<% for inv_group in @investor_group2 %>
- <%=h inv_group.title %>, <%=h inv_group.activated_members.size %>
<%end%>
Each item wrapped by a li tag, and all wrapped by an ul tag. If you look the previous code, this is exactly how it works:
content_tag(:ul, @investor_group2.map { |title| content_tag(:li, h(title)) })
An ul content tag, wrapping li content tags that wrap the titles.
And I did separate the title and the size in two erb, because I never tried put two information in the same, and don't now if it works.
Sorry any engrish.