ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  Rolling with Ruby on Rails, Part 2
Subject:   "Showing recipes in a category" code
Date:   2005-03-20 17:18:44
From:   curth
Response to: "Showing recipes in a category" code

Well, one way to do it would be to explicitly specify the SQL and use ORDER BY to do the sorting. Something like this:


@recipes = Recipe.find_by_sql("SELECT * FROM recipies ORDER BY category_id")