# Autocomplete partial issue

**URL:** <https://www.ruby-forum.com/t/autocomplete-partial-issue/174323>\
**Category:** Rails\
**Created:** [August 25, 2009, 3:13am UTC](https://www.ruby-forum.com/t/autocomplete-partial-issue/174323 "2009-08-25T03:13:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bigdaddy71](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bbe5ce/32.png) [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Post date:** [August 25, 2009, 3:13am UTC](https://www.ruby-forum.com/t/autocomplete-partial-issue/174323/1 "2009-08-25T03:13:19Z")

</div>

I am getting a ton of \t for some reason in front and behind the  
text. Anybody know why this is? If I comment out the image\_tag it  
does the same thing.

\<% unless @items.nil? %\>  
\<% content\_tag :ul, :class =\> “auto\_complete” do %\>  
\<% @items.each do |item| %\>  
\<% content\_tag :li do %\>  
\<% content\_tag :div do %\>  
\<%= image\_tag ‘/images/logo/logo.png’ %\>  
\<% content\_tag :span, h(item.name) %\>  
\<% end %\>  
\<% end %\>  
\<% end %\>  
\<% end %\>  
\<% end %\>

---

<div class="post-metadata">

**Author:** ![bigdaddy71](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bbe5ce/32.png) [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Post date:** [August 25, 2009, 2:57pm UTC](https://www.ruby-forum.com/t/autocomplete-partial-issue/174323/2 "2009-08-25T14:57:04Z")

</div>

On Aug 24, 2009, at 9:11 PM, Me wrote:

> \t \t \t \t \t \<%= image\_tag ‘/images/logo/logo.png’ %\>  
> \t \t \t \t \t \<% content\_tag :span, h(item.name) %\>  
> \t \t \t \t \<% end %\>  
> \t \t \t \<% end %\>  
> \t \t \<% end %\>  
> \t \<% end %\>  
> \<% end %\>

Does that make it clearer? You have tabs in your template. You can  
replace \<% %\> with \<%- -%\> to eliminate some of the whitespace or do:

\<% unless @items.nil? -%\>

\<% @items.each do |item| -%\>- 
 ![](https://www.ruby-forum.com/images/logo/logo.png)\<%=h(item.name) %\>
\<% end %\>
\<% end %\>

Or even:

ul.logo { list-style: disc url(/images/logo/logo.png) outer; }

\<% unless @items.nil? -%\>

\<% @items.each do |item| -%\>- \<%=h(item.name) %\>
\<% end %\>
\<% end %\>

Unless the

 and are serving some other purpose.

 

-Rob

 

Rob B. [http://agileconsultingllc.com](http://agileconsultingllc.com)  
removed\_email\_address@domain.invalid
