In the view you just do this
Message (<span id='char_count' ></span > characters)<br>
<%= text_area_tag :description %>
<%= character_count('description','char_count', :frequency => 0.10) %>
And in the helper, you have a 'character_count' method.
def character_count(field_id, update_id, options = {})
function = "$('#{update_id}').innerHTML = $F('#{field_id}').length;"
out = javascript_tag(function) # set current length
out += observe_field(field_id, options.merge(:function => function)) # and observe it
end
