-
-
Notifications
You must be signed in to change notification settings - Fork 183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gon.watch with unix top sample doesn't work on ubuntu 12.04? #71
Comments
Sorry for delay, I will check it soon and write to you results :) |
On my side though, no matter what I use, |
@wari I solved the same problem using to_json. For example: gon.watch.top = `top -b -n 1`.to_json |
Great @fermuch! I think I missed here |
Not sure if this is the right place for this, but I am also seeing the issue that gon.watch does not seem to work when passing in a string. For example, gon.watch.var1 = "foo" does not work, but putting the string in an array like gon.watch.var1 = ["foo"] does work. |
There are some problems while using watch. Maybe the best to do is to call a to_json on every object, and then use base64 to pass the variable, so we avoid unexpected calls. So, the client has to first transform base64 into JSON, and then parse the JSON. What do you think about this? |
I'm looking at a push solution and this seemed like the lightweight solution to fit my needs. So I tried the gon.watch.top example. Like to the others I ran into the issue with ubuntu 12x. Solved with suggestions posted. However, if I use the controller variable top (gon.watch.top), gon.watch.top or gon.all_variables returns nil (logged debug). If I change it to something else as in btop voila, values. The next issue is the data will not update the dom element. I get a continuous reload of the top.html.erb view but no data. It's a copy paste example and hard to screw up. The only change I made to example source was "top" to "btop". A view source shows the data getting picked up by gon.watch.btop but never makes it to the DOM. What might I be missing here? TIA!
|
I cannot replicate your error. You can try by encoding to base64 and decoding in your function before using the data. |
No joe. I deleted and recreated the example project. Interestingly, when
|
With Rails 3.2.11, Ruby1.9.3.From development log are:
when i change
top -l1
totop
, it seems the page just loading forever without any output.Did i make some mistake?@gazayThe text was updated successfully, but these errors were encountered: