Hi Everyone,
I have a number of records in a model called Kases, each kase record has a status which can be Active, On Hold, Invoice Sent or Archived.
I am trying to work out how to add a number on the dashboard for the total number of kase records, the total number of kase records marked as on hold, the total number of kase records marked as invoice sent, and the total number of kase records marked as archived.
Currently, I set the status of the kase record with the following:
<li>Case Status<span><%= f.select "kase_status", ['Active', 'On Hold', 'Archived', 'Invoice Sent'] %></span></li>
The kase_status is a field in the kases table, and is a string:
t.string :kase_status
Is there a simple way to do this?
Thanks,
Danny
EDIT:
Console Error Message:
>> Kases.find(:all).select { |k| k.kase_status == "Active"}.size
NameError: uninitialized constant Kases
from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:443:in `load_missing_constant'
from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:80:in `const_missing'
from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:92:in `const_missing'
from (irb):1
>>