Skip to content

Commit

Permalink
Refactored site#index tag cloud view code.
Browse files Browse the repository at this point in the history
  • Loading branch information
igal committed Oct 30, 2010
1 parent d4f8589 commit fff3d25
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions app/views/site/index.html.erb
Expand Up @@ -9,15 +9,9 @@

<div id="tagcloud">
<h2>Popular tags</h2>
<%- @tagcloud_items_deferred.call.tap do |items| -%>
<%- items.each_with_index do |item, i| -%>
<%# Clicking a tag does a tag-specific search: %>
<%= tag_link(:event, item[:tag], "tagcloud_level_#{item[:level]}") -%>
<%# Or clicking a tag does a normal search that happens to rank tags highly, but may return fuzzy matches: %>
<%#= link_to(item[:tag].name, search_events_path(:query => item[:tag].name), :class => "tagcloud_level_#{item[:level]}") %>
<%- unless i == items.length-1 -%><span class="spacer">&middot;</span><%- end -%>
<%- end -%>
<%- end -%>
<%= @tagcloud_items_deferred.call.map{ |item|
tag_link(:event, item[:tag], "tagcloud_level_#{item[:level]}")
}.join('<span class="spacer"> &middot; </span>') -%>
</div>
</div>

Expand Down

0 comments on commit fff3d25

Please sign in to comment.