I'm making a simple rails (3.2.11) demo that only i will be accessing. I have the following:
1) a Rails scaffold named Food
2) an android device that can call in to a custom route/controller that will then create a new Food. (Food.create...
).
So, on my computer's browser, I load up http://myapp.com
, which is hosting the rails app. Immediately, it loads up all foods because it's rendering foods#index
. However, the moment i create a new Food
by calling in from my android device, the browser page (on my computer) is still showing the old list of foods, even though the database knows there's a new food. (because at this point i still haven't refreshed the page)
How do i add a "listener/observer" to refresh the page automatically, when the database changes for the Food
table? is this possible?
i'm NOT looking for <meta http-equiv="refresh" content="5">
as I would like to leave my computer's browser on for the entire 30 min demo.
=================
also, i haven't used rails in over 3 years, so if you are kind enough to answer, please explain it so that a beginner would understand? (explicit details are preferred)