Hello all,
Could someone point me towards a recipe for getting the content of a
page to update based on changes in the database (versus updates to
controls on the page, for example), please?
Ideally I'd like fields on the page to change colour as activity
occurs asynchronously in the database, so perhaps updates would happen
in response to a timed event on the server side.
Thanks in advance,
Henry
Look at periodically_call_remote.
http://api.rubyonrails.org
-Bill
Henry Collingridge wrote:
If you already know when stuff is to change without re-querying the db
you can use simple javascript:
var seconds = 100
document.content.fieldFoo.value = '100'
function display()
{
document.content.fieldFoo.value = seconds
if( seconds > 0 ) seconds -= 1
if( seconds <= 0 ) window.location.reload( true );
setTimeout( 'display()', 1000 )
}
display()