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 %>
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| -%>
<%=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