Displaying 1 result from an estimated 1 matches for "all_record".
2006 Apr 27
12
how to do a count with a variable...
hi guys, got this problem...
in my controller, when i wanna do a @temp.count it fails...
then i went to try counter = @temp.count which also failed..
thus, i feel that the count is not available for ActiveRecord::Base..so
i went to the Model class eg. user.rb
so in user.rb :
...
def count_uesr
count = 0
self.each do |record|
count ++
end
return count
end
then it ended up having