search for: count_uesr

Displaying 1 result from an estimated 1 matches for "count_uesr".

Did you mean: count_err
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 undefined method for ''each'' .... omg ... anyone can suggest how to go about doing it??? thanks thanks -- Posted via http://www.ruby-forum.com/.