according to the book 'Agile web dev.." page 125
I am using rails 4.0 and hit the following error.
Is latest a method or not?
Thanks
undefined method `latest' for #<Class:0x007fca86206d88>
Extracted source (around line #7):
4 5 6 7 8 9 10 |
|
--
You received this message because you are subscribed to the Google Groups "Hong Kong Ruby on Rails" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hkror+un...@googlegroups.com.
To post to this group, send email to hk...@googlegroups.com.
Visit this group at http://groups.google.com/group/hkror.
For more options, visit https://groups.google.com/groups/opt_out.
config.action_controller.perform_caching = true
def self.latest
Product.order(:updated_at).last
end