box-o-sand/cookbook/015/hodgepodge/app/controllers/list_controller.rb

21 lines
336 B
Ruby
Raw Normal View History

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