2011-08-11 02:06:36 +00:00
|
|
|
require 'sha1'
|
|
|
|
|
|
|
|
class ListController < ApplicationController
|
|
|
|
def index
|
|
|
|
@list = [1, "string", :symbol, ['list']]
|
|
|
|
end
|
|
|
|
|
2011-08-11 02:51:14 +00:00
|
|
|
def shopping_list
|
|
|
|
@list = [ListItem.new(4, 'aspirin'), ListItem.new(199, 'succotash')]
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
class ListItem
|
|
|
|
attr_accessor :name, :id
|
|
|
|
def initialize(id, name)
|
|
|
|
@id, @name = id, name
|
|
|
|
end
|
2011-08-11 02:06:36 +00:00
|
|
|
end
|