This last command will fail because rails does not recognize the Category model inside the subcategories model. So all you have to do is tell Rails that you want to include another model in the query, and this is done using the :include option from the find method:

Tuesday, March 3, 2009

If you need to set the default formatting of dates throughout your whole application in Ruby on Rails, just add the following line to your "<your application>/config/environment.rb"my_date_formats = { :default => '%d/%m/%Y' }