Tail -f and periodically call remote

Is there some way to tail -f a file and print whatever tail -f gets to
the browser on the client side. I’m thinking periodically call remote
can do it. Is there some shortcut method, or does one have to store the
cursor line that they read up to from the file last time, and then start
reading again from the new cursor on the next periodically call remote.

thanks

In your controller:

def my_poller
@filename="#{RAILS_ROOT}/log/development.log"
render :text => tail -f #{@filename}
end

Hope it helps,

Roland

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs