Skip to content

Instantly share code, notes, and snippets.

@5v3n
Created June 24, 2010 23:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 5v3n/452136 to your computer and use it in GitHub Desktop.
Save 5v3n/452136 to your computer and use it in GitHub Desktop.
<%#
# search given tags...
%>
<%
require File.join(File.dirname(__FILE__), 'src', 'toto_decoration')
decorator = TotoDecoration.new
%>
<!-- list of all articles & their tags:
<% @articles.each do |a|
tags = decorator.process_to_array(a[:tags])
%>tags from @articles[<%= a[:title]%>]: <%= tags.inspect %><br/>
<% end %>
-->
<% @articles.select do |a|
tags = decorator.process_to_array(a[:tags])
tags.include?("hacks")
end[0...10].each do |article| %>
<a href="<%= article.path %>"><%= article.title %></a><br/>
<% end %>
<br/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment