here is a demo for a very simple (and lame) solution:
in your model, create an array with filled fields plus an entire field to store the current state, for example:
class User < AR::Base PROFILE_COMPLETENESS = %w[email, website_url, personal-info, etc ] before_update :update_profile_progress, :if => Proc.new {|u| u.progress_status < 100} private def update_profile_progress progress = 0 PROFILE_COMPLETENESS.each do |field| progress += 1 unless field.blank? end self.progress_status = (progress / PROFILE_COMPLETENESS * 100).to_i end end
Thus, every time a user updates his profile, the percentage is updated (only if he is below 100%).
Perhaps there are better solutions, this is just a possible approach to the problem;)
source share