I think I might have something…

Posted by Matt on August 20, 2007

So it seems as though I can do something like this in Ruby:

 
  def list
    @objects = Hash.new
    Object.find(:all).each { |r|
      status = "Open"
      @objects[r.id] = {
          "ID"            => r.id,
          "Name"          => r.name,
          "Author"        => r.user.name,
          "Status"        => status,
          "Date Created"  => r.created,
          "Last Activity" => r.modified
        }
    }
  end
 

That kind of mimics what I'm doing in CakePHP with multidimensional arrays.

Trackbacks

Use this link to trackback from your own site.

Comments

Leave a response

Comments