Less than 1 min to read (164 words)

Testing Body Detail Estimate In Minutes

Tags: rails

These last two days I added a feature to the blog, which is to estimate the time it takes to read the entry. I added a table called BodyEntryDetail with EntryId as a foreign key. Then, I added Entry#word_count and Entry#estimate_in_minutes to compute how long it would take to read the entry; the estimate is based on the number of words in the entry body.

I made sure if the entry updated, then its body entry detail would update as well. I've been noticing article estimates at Medium and Slate, so I am excited to add it here!

How might I improve this feature? I might add JavaScript to my blog manager tool to indicate a growing word count (and time estimate) as I continue typing. I want to make sure that any tools I build keep getting technically better as well. It's more fun to see immediate visual changes, but remember -- better tools help with output!

posted 2015-04-27 23:08:36 -0700 by Belda

Recommended from Stack Overflow:

rake assets:precompile misses jquery-ui-rails files , tagged: ["ruby-on-rails", "asset-pipeline", "activeadmin"]

Rails - how to run a cmd line script and display the output in real time? , tagged: ["ruby-on-rails", "ruby"]

How to get localized values from Facebook Open Graph API through Koala? , tagged: ["facebook-graph-api", "translation", "koala-gem"]

Why does Active Record use module_eval internally for certain features? , tagged: ["ruby-on-rails", "ruby", "activerecord", "ruby-on-rails-4"]