I regularly contribute to a ruby project called Octobox. I’ve been mucking around with an auto refresh feature, which simply reloads the page every 120 seconds.
Would it work? I know it would in .html, but this is a .html.erb file, so I’m not too familiar with it.
Thanks in advance!
If you want the page to be refreshed after EVERY 120 seconds, you could just write a
setTimeout in the html page.
head section do this
<meta http-equiv="refresh" content="120" />
<!-- Added new code below -->
var RELOAD_AFTER = 2 * 60 * 1000; // 120 seconds or 2 minutes
}, RELOAD_AFTER );
This looks great! Thank you!
Is there any way I can apply it only to part of the ruby site, for example this div tag?
<div class="blankslate blankslate-spacious blankslate-clean-background">
<%= octicon 'mail-read', height: 32, class: 'blankslate-icon' %>
<%= octicon 'thumbsup', height: 32, class: 'blankslate-icon' %>
<h3>You're in the clear!</h3>
<p>There are no notifications that need your attention.</p>
<% if current_user.last_synced_at %>
<small>Last sync: <%= time_ago_in_words current_user.last_synced_at %> ago</small>
<% end %>
I’m not sure how ruby will help here though.