[email protected] wrote: > On 17 Mar., 16:28, "[email protected]" <[email protected]> wrote: >> >> > > Thank you clever people!!!! >> >> > Assuming the name of your model is Item, you can do it this way: >> >> > Enquries Today: <%= Item.count %> >> >> > Just replace "Item" with whatever your model is called. #count is a >> > method provided by ActiveRecord, that will return the number of >> > records in the table that the table belongs to, "items" for example. >> >> * in the model that the table belongs to, "items" for example. > > Argh, in the table that model belongs to, of course. So sorry. :/
Hi thankyou for that very quick reply but I getting: undefined method `count' for #<Enquiry:0x41698fc> I am placing this in my index page like this: Enquries Today: <%= enquiry.count %> thanks again -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

