From: "David A. Black" Date: 2008-09-11T19:15:23+09:00 Subject: Re: Getting values from array of arrays Hi -- On Thu, 11 Sep 2008, Allen Walker wrote: > Thanks. I was following along in Pragmatic - Agile Web Development with > Rails and they were using an Array of Arrays. But I changed it to a hash > which makes more sense and it works. > > I know this isn't a rails forum but I am just commenting on your > suggest. > > So you don't think: > @news = Article.find( :all, > :conditions => ["category = ?", > Article::ARTICLE_CATEGORIES["News"]]) > > should be in the controller but instead I should wrap that into a method > in the model? Yes. I don't think the controller should know the details of the ARTICLE_CATEGORIES data structure. David -- Rails training from David A. Black and Ruby Power and Light: Intro to Ruby on Rails January 12-15 Fort Lauderdale, FL Advancing with Rails January 19-22 Fort Lauderdale, FL * * Co-taught with Patrick Ewing! See http://www.rubypal.com for details and updates!