Hey gurus! I''ve been playing with the cookbook app (as this was what i''ve been looking for for a while) and want to be able to SORT the lists. What is the simplest way to sort the output? for example in: http://www.mycookbook.com/recipe/list (Show all Recipes) How could I sort it by column one (recipe title), then by column two (recipe category) Thanks a million in advance, Ryan PS: I''m loving playing with ruby on rails via InstantRails. I''ve been looking high and low for over a year before someone showed me this. Now I''m the happiest person ever. The flexibility.. etc. Very Very Well done!
On 1/17/06, MaxSteel <maxsteel at gmail.com> wrote:> > Hey gurus! > > I''ve been playing with the cookbook app (as this was what i''ve been > looking for for a while) and want to be able to SORT the lists. > > What is the simplest way to sort the output? > > for example in: http://www.mycookbook.com/recipe/list > (Show all Recipes) > > How could I sort it by column one (recipe title), then by column two > (recipe category) >This kind of queston is probably better asked on the Rails ML, but what you want to do is something like this: receipes = Recipe.find( :all, :order => "title, category_id") Curt -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/instantrails-users/attachments/20060117/e293a6ce/attachment.htm
Man.. that was easy! Thanks Curt, that worked excellently! On 1/17/06, Curt Hibbs <curt.hibbs at gmail.com> wrote:> This kind of queston is probably better asked on the Rails ML, but what you > want to do is something like this: > > receipes = Recipe.find( :all, :order => "title, category_id") > > Curt > > On 1/17/06, MaxSteel <maxsteel at gmail.com> wrote: > > Hey gurus! > > > > I''ve been playing with the cookbook app (as this was what i''ve been > > looking for for a while) and want to be able to SORT the lists. > > > > What is the simplest way to sort the output? > > > > for example in: http://www.mycookbook.com/recipe/list > > (Show all Recipes) > > > > How could I sort it by column one (recipe title), then by column two > > (recipe category) > >