Answer the question
In order to leave comments, you need to log in
Timers in Ruby/Rails, any ready-made solutions?
It is necessary to refresh the page after a certain period of time, which depends on the value in the database.
Are there ready-made timers (gems) that can handle this task?
Answer the question
In order to leave comments, you need to log in
controller
class MyController < ApplicationController
def show
@timer = 50; # for example
render :show
end
end
<meta http-equiv="Refresh" content="<%= @timer %>">
Yes, the GON gem has a watch method to just pull the value at the right frequency - https://github.com/gazay/gon
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question