working through 15.13

This commit is contained in:
Dan Buch
2011-08-10 22:06:36 -04:00
parent feaea1636c
commit aac108a50d
6 changed files with 31 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
require 'sha1'
class ListController < ApplicationController
def index
@list = [1, "string", :symbol, ['list']]
end
end

View File

@@ -0,0 +1,2 @@
module ListHelper
end

View File

@@ -0,0 +1,6 @@
<ul style="font-family:monospace;">
<% @list.each_with_index do |item, i| %>
<li class="<%= i % 2 == 0 ? 'even' : 'odd' %>"><%= i %>:
<%= SHA1.new(item.id.to_s) %></li>
<% end %>
</ul>