On Aug 24, 2009, at 9:11 PM, Me wrote:
>
> 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? %>
> \t <% content_tag :ul, :class => "auto_complete" do %>
> \t \t <% @items.each do |item| %>
> \t \t \t <% content_tag :li do %>
> \t \t \t \t <% content_tag :div do %>
> \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? -%>
<ul class="auto_complete">
<% @items.each do |item| -%>
<li><div><img src=''/images/logo/logo.png''
/><span><%=h(item.name) %></
span></div></li>
<% end %>
</ul>
<% end %>
Or even:
<style type="text/css">
ul.logo {
list-style: disc url(/images/logo/logo.png) outer;
}
</style>
<% unless @items.nil? -%>
<ul class="auto_complete logo">
<% @items.each do |item| -%>
<li><%=h(item.name) %></li>
<% end %>
</ul>
<% end %>
Unless the <div/> and <span/> are serving some other purpose.
-Rob
Rob Biedenharn http://agileconsultingllc.com
Rob-xa9cJyRlE0mWcWVYNo9pwxS2lgjeYSpx@public.gmane.org