Autocomplete in rails format data and display in a beatiful way
Posted
by
alexeyb
on Stack Overflow
See other posts from Stack Overflow
or by alexeyb
Published on 2012-04-02T10:21:01Z
Indexed on
2012/04/02
11:29 UTC
Read the original article
Hit count: 300
I use rails 3.2.2 and autocomplete, I m selecting customer by name and formating it in a following way
format.json { render :json => @customers.map{ |c| "#{c.name}:#{c.phone1}:#{c.email}" } }
so, i need to parse json properly an display in a way i want for example I want write name in but make phone smaller and bold ,display it in different color. How i can achive that?
<ul class="ui-autocomplete ui-menu ui-widget ui-widget-content ui-corner-all" role="listbox" aria-activedescendant="ui-active-menuitem" style="z-index: 1; top: 416px; left: 0px; display: none; width: 419px;">
<li class="ui-menu-item" role="menuitem">
<a class="ui-corner-all" tabindex="-1">Adele Brekke:1-244-712-4421 x313:[email protected]</a>
</li>
<li class="ui-menu-item" role="menuitem">
<a class="ui-corner-all" tabindex="-1">Madeline O'Conner Sr.:486-349-1046 x6765:[email protected]</a>
</li>
</ul>
Thanks
© Stack Overflow or respective owner