Skip to content

Instantly share code, notes, and snippets.

View rickpeyton's full-sized avatar

Rick Peyton rickpeyton

View GitHub Profile
@barelyknown
barelyknown / unobtrusive_poller.js.coffee
Last active April 25, 2019 21:01
Unobtrusive JavaScript solution for polling in a Rails application
###
Unobtrusive JavaScript solution for polling in a Rails application
Introduction:
Add a polling-placeholder wrapper div to any partial and add a data attribute
named poll that should be equal to "true" until you want to stop polling.
The default polling frequency will be used unless you provide an "interval" data
attribute which should be the number of milliseconds to use for the interval.